(function(a) {
	a.fn.extend({
		MOGU_Follow: function(b) {
			var c = {
					a_addfo: "<a href='javascript:;' class='addfo'>\u52a0\u5173\u6ce8</a>",
					a_delfo: "<a href='javascript:;' class='delfo'>\u53d6\u6d88\u5173\u6ce8</a>",
					span_fook: "<span class='fo_ok'>OK</span>",
					span_followed: "<span class='followed'>\u5df2\u5173\u6ce8</span>",
					add_all: "<span class='addall'>\u4e92\u76f8\u5173\u6ce8</span><a class='unfollow' href='javascript:void(0);' >\u53d6\u6d88</a>",
					add_ok: '<span class="add_ok">\u5df2\u5173\u6ce8</span><a href="javascript:void(0);" class="unfollow">\u53d6\u6d88</a>',
					add_e: "<a class='add_e' href='javascript:;'>\u5173\u6ce8</a>",
					add_a: "<span class='addall' href='javascript:;'>\u4e92\u76f8\u5173\u6ce8</span>"
				},
				f = a.extend({
					wrap_div_class: "followdiv",
					add_fos: "one",
					addfo_class: "addfo"
				}, b),
				b = a("." + f.wrap_div_class),
				d = {};
			a(".addfo,.add_e", b).live("click", function() {
				if (MOGUPROFILE.userid == "") {
					MOGU.user_handsome_login_init();
					var c = a(this);
					MOGU.user_handsome_login(!1, {
						callback: function() {
							c.click()
						}
					})
				} else {
					if ("one" === f.add_fos) var b = a(this).parent().attr("uid"),
						b = Array(b);
					d = {
						followIds: b
					};
					g("/collect/addfollow", d, a(this), "add_follow")
				}
			});
			a(".unfollow", b).live("click", function() {
				if (!confirm("\u786e\u5b9a\u8981\u53d6\u6d88\u5173\u6ce8\u4e48\uff1f")) return !1;
				d = {
					followIds: a(this).parent().attr("uid")
				};
				g("/collect/unfollow", d, a(this), "del_fo")
			});
			a(".addfo_all").click(function() {
				var c = [],
					b = [];
				a(".si_friends .sif_f").each(function() {
					a(this).find(".s_in").attr("checked") == "checked" && (c.push(a(this).find(".foit").attr("uid")), b.push(a(this).find(".foit").attr("sname")), a(this).parent().remove(),
						a(this).fadeOut(500, function() {}))
				});
				if (c.length == 0) return alert("\u8bf7\u9009\u62e9\u7528\u6237!"), !1;
				a(".si_friends li").size() == 0 && a(".sina_invite, .si_down").fadeOut();
				d = {
					followIds: c,
					zone_sina_fo: "zone_sina_fo",
					sina_name_array: b
				};
				g("/collect/addfollow", d, a(this), "add_follow")
			});
			var g = function(b, d, e, g) {
				a.ajax({
					url: b,
					type: "POST",
					timeout: 6E4,
					data: d,
					dataType: "json",
					success: function(a) {
						if (a == null) alert(MGLANG.msgTimeout);
						else {
							var b = a.status.msg;
							a.status.code == 1001 ? (a = a.result.data.relationships[0],
								"add_follow" == g ? e.parent().attr("type") == "all" ? a == "r1" ? e.parent().html(c.add_ok) : a == "r3" && e.parent().html(c.add_all) : e.attr("type") != "sina" && (e.parent().attr("type") == "group" ? e.parent().html(c.span_followed) : a == "r1" ? e.parent().html(c.span_followed) : a == "r3" && e.parent().html(c.add_a)) : "del_fo" == g && (a == "r2" ? e.parent().html(c.add_e) : a == "r0" && e.parent().html(c.a_addfo))) : alert(b)
						}
					},
					error: function(a, c) {
						"timeout" == c && alert(MGLANG.msgTimeout)
					}
				})
			};
			return this
		}
	});
	MOGU.FollowStar = function() {
		a(".follow_star_div .addfo").live("click",
			function() {
				if (MOGUPROFILE.userid == "") {
					MOGU.user_handsome_login_init();
					var b = a(this);
					MOGU.user_handsome_login(!1, {
						callback: function() {
							b.click()
						}
					})
				} else {
					var c = a(this).parent(),
						f = c.attr("sid"),
						d = '<span class="add_ok">\u5df2\u5173\u6ce8</span><a href="javascript:;" class="unfollow">\u53d6\u6d88</a>';
					c.attr("type") == "noadd" && (d = '<span class="followed">\u5df2\u5173\u6ce8</span>');
					a.ajax({
						url: "/star/follow",
						data: {
							starId: f
						},
						type: "post",
						dataType: "json",
						success: function(a) {
							if (a == null) alert(MGLANG.msgTimeout);
							else {
								var b = a.status.msg;
								a.status.code == 1001 ? c.html(d) : alert(b)
							}
						}
					})
				}
			});
		a(".follow_star_div .unfollow").live("click", function() {
			if (MOGUPROFILE.userid == "") {
				MOGU.user_handsome_login_init();
				var b = a(this);
				MOGU.user_handsome_login(!1, {
					callback: function() {
						b.click()
					}
				})
			} else {
				var c = a(this).parent(),
					f = c.attr("sid");
				a.ajax({
					url: "/star/delfollow",
					data: {
						starId: f
					},
					type: "post",
					dataType: "json",
					success: function(a) {
						if (a == null) alert(MGLANG.msgTimeout);
						else {
							var b = a.status.msg;
							a.status.code == 1001 ? c.html('<a class="addfo" href="javascript:;">\u5173\u6ce8</a>') :
								alert(b)
						}
					}
				})
			}
		})
	};
	a(".followdiv").MOGU_Follow();
	MOGU.FollowStar()
})(jQuery);
! function(a) {
	a.fn.pubimg = function(b) {
		var c = {
				callback: function(a, b, c, d, e) {
					MGTOOL.log("code:" + a), MGTOOL.log("msg:" + b), MGTOOL.log("imgId:" + c), MGTOOL.log("path:" + d), MGTOOL.log(e)
				},
				prefun: function() {
					return !0
				},
				ifUserLogin: !0
			},
			d = a.extend({}, c, b),
			e = function() {
				var a = "publish_tool_photo_success_",
					b = Math.floor(99 * Math.random() + 1),
					c = a + b;
				return window[c] ? e() : c
			};
		return d.funName = e(), this.each(function() {
			var b = a(this),
				c = !0;
			b.unbind("click"), b.bind("click", function() {
				if (d.ifUserLogin && "" == MOGUPROFILE.userid) {
					MOGU.user_handsome_login_init();
					var a = b,
						e = {
							callback: function() {
								a.show(), a.click()
							}
						};
					return MOGU.user_handsome_login(!1, e), c = !1, !1
				}
				return d.prefun && !d.prefun(b) ? (c = !1, !1) : (c = !0, void 0)
			}), b.unbind("change"), b.bind("change", function() {
				if (!c) return !1;
				var e = {
					title: "",
					lightBoxId: "lb_loading",
					ajax: !0,
					isBgClickClose: !1
				};
				loading_light_box = new MGLightBox(e), loading_light_box.init();
				var f = null;
				setTimeout(function() {
					a("#ifr_picup").parent().remove(), f && clearInterval(f);
					var c = b.parents("form");
					"www.mogujie.com" != location.hostname ? 0 == c.find("input[name=host]").size() && c.append('<input type="hidden" value="' + location.host + '" name="host">') : (0 == c.find("input[name=host]").size() && c.append('<input type="hidden" value="' + location.host + '" name="host">'), c.attr("action", "http://upload.mogujie.com/upload/addpic/")), 0 == c.find("input[name=callback]").size() && c.append('<input type="hidden" value="' + d.funName + '" name="callback">'), 0 == a("#ifr_picup").size() && a("body").append('<div style="display: none;"><iframe frameborder="0" name="ifr_picup" id="ifr_picup" src="about:blank"></iframe></div>'), c.attr("target", "ifr_picup"), c.submit(), b.val("");
					var e = 0;
					f = setInterval(function() {
						180 == e && (a("#ifr_picup").parent().remove(), alert(MGLANG.msgTimeout), clearInterval(f)), e++
					}, 1e3), window[d.funName] = function(a, c, e, g) {
						return loading_light_box.close(), clearInterval(f), 1001 != a ? (alert(c), void 0) : (d.callback(a, c, e, g, b), void 0)
					}
				}, 0)
			})
		})
	}
}(jQuery);
(function(a) {
	MOGU.Zone_Choose_Album = function() {
		var f = a(".chose_album .choose"),
			g = a(".chose_album .choose_r");
		a(".chose_album .choose").live("click", function() {
			a("#zone_album").size() == 0 && a("body").append('<div class="my_album" id="zone_album"><div class="album_pr"><div class="my_album_list"></div><div class="create clearfix"><input type="text" class="album_name" value="\u8f93\u5165\u65b0\u4e13\u8f91\u540d"><a href="javascript:;" class="blue_button to_create r3">\u521b\u5efa</a></div></div></div>');
			var e = a(".my_album"),
				d = a(this).offset();
			e.css({
				top: d.top + a(this).height(),
				left: d.left
			});
			e.toggle();
			if (e.css("display") == "none") return a("body").unbind("click"), !1;
			else a.ajax({
				url: "/album/useralbums",
				type: "post",
				timeout: 6E4,
				dataType: "json",
				success: function(c) {
					if (c == null) alert(MGLANG.msgTimeOut);
					else {
						var b = c.status.msg;
						if (c.status.code == 1001) {
							b = c.result.html;
							c = c.result.pages;
							f.addClass("slide");
							g.addClass("slide_r");
							a(".chose_album .choose");
							var e = a("#zone_album .my_album_list");
							e.html(b);
							c > 1 && e.addClass("scroll");
							MOGU.Globe_Input_Text(a("#zone_album .album_name"));
							i()
						} else alert(b)
					}
				},
				error: function(a, b) {
					"timeout" == b && alert(MGLANG.msgTimeout)
				}
			})
		});
		a("#zone_album .album_ul li").live("click", function() {
			var e = a("#zone_album"),
				d = a(this).find(".m_i"),
				c = a(this);
			if (!d.prop("checked")) {
				a("#zone_album .album_ul li").removeClass("checked");
				d.prop("checked", !0);
				var d = c.find(".m_a"),
					b = a(".chose_album .choose");
				b.data("albumid", c.attr("album"));
				b.html(MGTOOL.jsMbSubstr(d.text(), 10) + "<b></b>")
			}
			e.hide();
			f.removeClass("slide");
			g.removeClass("slide_r");
			a(".chose_album .cancel").show()
		}).live({
			mouseenter: function() {
				a(this).addClass("checked")
			},
			mouseleave: function() {
				a(this).removeClass("checked")
			}
		});
		a("#zone_album .create .to_create").live("click", function() {
			var e = a("#zone_album"),
				d = a("#zone_album .album_name").attr("value");
			d === "" || d === "\u8f93\u5165\u65b0\u4e13\u8f91\u540d" ? (e.show(), alert("\u8bf7\u8f93\u5165\u65b0\u4e13\u8f91\u540d")) : a.ajax({
				url: "/album/newajax",
				type: "post",
				timeout: 6E4,
				data: {
					title: d,
					type: 0
				},
				dataType: "json",
				success: function(c) {
					if (c == null) alert(MGLANG.msgTimeOut);
					else {
						var b = c.status.msg;
						if (c.status.code == 1001) {
							var b = c.result.title,
								c = c.result.albumId,
								d = a(".chose_album .choose");
							d.data("albumid", c);
							d.html(MGTOOL.jsMbSubstr(b, 10) + "<b></b>");
							e.hide();
							f.removeClass("slide");
							g.removeClass("slide_r");
							a(".chose_album .cancel").show()
						} else alert(b)
					}
				},
				error: function(a, b) {
					"timeout" == b && alert(MGLANG.msgTimeout)
				},
				complete: function() {
					e.hide()
				}
			})
		});
		var i = function() {
				if (a("#zone_album").css("display") == "block") {
					var e =
						a("#zone_album .create .album_name"),
						d = a("#zone_album .page_slide"),
						c = a(".chose_album");
					a("body").bind("click", function(b) {
						b = b || window.event;
						b = b.target || b.srcElement;
						!h(b, e[0]) && !h(b, d[0]) && !h(b, c[0]) && (a("#zone_album").hide(), a("body").unbind("click"))
					})
				}
			},
			h = function(a, d) {
				for (; a != void 0 && a != null && a.tagName.toUpperCase() != "BODY";) {
					if (a == d) return !0;
					a = a.parentNode
				}
				return !1
			};
		a(".chose_album .cancel").live("click", function() {
			a(".chose_album .choose").removeData("albumid");
			a(".chose_album .choose").html("\u9009\u62e9\u4e13\u8f91<b></b>");
			a(".chose_album .cancel").hide()
		})
	};
	MOGU.Zone_Choose_Album()
})(jQuery);
! function(a) {
	var b = ['<ul class="lb_tab">', "{{ $.each(it.tab, function(index, item) { }}", '<li f="{{=index + 1}}" title="{{=item.name}}" class="rt3 {{ if (index === 0) { }} c {{ } }}">', '<a href="javascript:;" onclick="return false;">{{=item.name}}</a>', "</li>", "{{ }); }}", "</ul>"].join(""),
		c = ['<ul class="face_l" title="{{=it.name}}">', "{{ $.each(it.face, function(index, item) { }}", '<li title="{{=item.title}}">', '<a href="javascript:;" ><img src="{{=item.src}}" /></a>', "</li>", "{{ }); }}", "</ul>"].join("");
	window.MGFACE = {};
	var d = function(d) {
		MGFACE.faceTab = MGTOOL.template(b, {
			tab: d.tab
		}), MGFACE.facePage = {};
		for (var e = d.page, f = 0, g = e.length; g > f; f++) MGFACE.facePage["f" + (f + 1)] = MGTOOL.template(c, e[f]);
		MOGU.WB_Add_Face_Init_New = function(b) {
			var c = this,
				d = {
					output: "#pub_content",
					fix: 25,
					left_fix: 0
				},
				e = a.extend(d, b),
				f = null,
				g = null,
				h = "lb_face_v2",
				i = !1,
				j = e.output;
			c.init = function() {
				a("#" + h).remove(), a("#" + h + " .lb_tab li a").unbind("click"), a("#" + h + " .lb_close").unbind("click"), a("#" + h + " .lb_bd li a").unbind("click"), clearTimeout(f);
				var b = MGTEMPLATE.twitterLightBox;
				b = b.replace(/{title}/g, MGFACE.faceTab).replace(/{body}/g, MGFACE.facePage.f1).replace(/{id}/g, h), a("body").append(b), g = a("#" + h);
				var c = e.click_obj.offset(),
					d = c.left - e.left_fix;
				c.left + 500 > a(window).width() && (d = c.left - 470, g.find(".arrows").css("left", 475)), g.css({
					top: c.top + e.fix + "px",
					left: d + "px"
				}), g.show(), f = setTimeout(function() {
					g.remove()
				}, 3e3), g.hover(function() {
					clearTimeout(f), g.show(), i = !0
				}, function() {
					clearTimeout(f), f = setTimeout(function() {
						g.remove()
					}, 500), i = !1
				}), a("#" + h + " .lb_tab li a").bind("click", function() {
					a("#" + h + " .lb_tab li").removeClass("c"), a(this).parent().addClass("c"), a("#" + h + " .lb_bd").html(MGFACE.facePage["f" + a(this).parent().attr("f")]), k()
				});
				var k = function() {
					a("#" + h + " .lb_bd li a").bind("click", function(b) {
						var c = j.val();
						c == j.attr("def-v") && (j.val(""), c = ""), j.focus();
						var d = "[" + a(this).parent().attr("title") + "]";
						if ("undefined" != typeof document.selection) document.selection.createRange().text = d;
						else {
							var e = j[0].selectionStart;
							j.val(c.substr(0, e) + d + c.substring(e, c.length)), j[0].setSelectionRange(e + d.length, e + d.length)
						}
						clearTimeout(f), a("#" + h).show(), f = setTimeout(function() {
							a("#" + h).remove()
						}, 2e3), b.preventDefault()
					})
				};
				k(), a("#" + h + " .lb_close").bind("click", function(b) {
					a("#" + h).remove(), b.preventDefault()
				})
			}
		}
	};
	a(document).ready(function() {
		a.ajax({
			url: MOGUPROFILE.cdnHost + "/__/js/module/module-data-face.js$2014010301.js",
			cache: !0,
			dataType: "script",
			success: function() {
				MOGU && MOGU.__faceData && d(MOGU.__faceData)
			}
		})
	})
}(jQuery);
(function(d) {
	MOGU.Img_Pub_Widget = function(i) {
		var j = {
				img_limit: 3,
				pub_img_content: d(".pub_img_content"),
				up_another_div: d(".pub_img_content .up_another"),
				up_default_div: d(".pub_img_content .default"),
				del_wrap: "img_wrap",
				hide_img_content: !1
			},
			b = d.extend(j, i),
			g = function(a) {
				a == 0 ? b.up_default_div.show() : a < b.img_limit ? (b.up_default_div.hide(), b.up_another_div.show(), b.pub_img_content.show()) : (b.up_default_div.hide(), b.up_another_div.hide())
			},
			f = {
				get_img_array: function() {
					return typeof b.pub_img_content.data("img_array") ===
						"undefined" ? "" : b.pub_img_content.data("img_array")
				},
				get_img_count: function() {
					var a = this.get_img_array();
					return d.trim(a) == "" ? 0 : a.replace(/^,+/, "").replace(/,+$/, "").split(/,+/).length
				},
				set_img_count: function(a) {
					var c = this.get_img_array();
					MGTOOL.log("1:" + c);
					c += a + ",";
					MGTOOL.log("2:" + c);
					b.pub_img_content.data("img_array", c);
					return this.get_img_count()
				},
				del_img_count: function(a) {
					var c = this.get_img_array(),
						c = c.replace(a + ",", "");
					b.pub_img_content.data("img_array", c);
					return this.get_img_count()
				}
			};
		(function() {
			b.pub_img_content.find(".add_file").pubimg({
				prefun: function() {
					b.pub_img_content.data("img_array");
					var a = f.get_img_count();
					return b.img_limit > a
				},
				callback: function(a, c, e, h) {
					b.uppic_cb ? b.uppic_cb(a, c, e, h) : (a = {
						imgId: e,
						path: h + "_100x100.jpg"
					}, d(".up_another").show(), d(".up_another").before(MGTOOL.template('<div class="img_wrap r5"><img src="{{= it.path }}" class="r5"><a href="javascript:;" class="del" iid="{{= it.imgId }}"></a></div>', a)));
					e = f.set_img_count(e);
					g(e)
				}
			})
		})();
		(function() {
			b.pub_img_content.find(".del").live("click", function() {
				var a = d(this);
				a.parents("." + b.del_wrap).remove();
				d(".up_another").hide();
				a = f.del_img_count(a.attr("iid"));
				g(a)
			})
		})()
	}
})(jQuery);
(function(a) {
	MOGU.WB_Add_Face_Init = function() {
		var f = null,
			b = null,
			d = null,
			i = !1;
		a(".add_face").live("click", function() {
			var c = a(this).attr("w");
			(i = c == "fw" || c == "sm" || c == "at_ta" || c == "lpt" || c == "book_addalbum" || c == "acc" || c == "follow_add" || c == "whisper" || c == "group_add" || c == "message_talk") || a(".light_box").remove();
			clearTimeout(f);
			var e = MGTEMPLATE.twitterLightBox,
				e = e.replace(/{title}/g, MGFACE.faceTab).replace(/{body}/g, MGFACE.facePage.f1).replace(/{id}/g, "lb_face");
			a("body").append(e);
			d = a("#lb_face");
			var e = a(this).offset(),
				g = 25;
			c == "fw" && (g = 60);
			var h = e.left;
			e.left + 500 > a(window).width() && (h = e.left - 470, d.find(".arrows").css("left", 475));
			d.css({
				top: e.top + g + "px",
				left: h + "px"
			});
			c == "album_rpl" && d.css({
				top: e.top + g + "px",
				left: h - 400 + "px"
			});
			d.show();
			switch (c) {
				case "tpk":
				case "evt":
				case "note":
					b = a("#pub_content");
					break;
				case "pub":
					b = a("#pub_content");
					break;
				case "f":
					b = a(this).parents(".cf_pub_b").find(".pub_txt");
					break;
				case "fw":
					b = a("#lb_forward .fw_content");
					break;
				case "cm":
					b = a(this).next(".reply_content");
					break;
				case "newtpk":
					b = a("#topic_con textarea");
					break;
				case "single":
					b = a("#comment_box .comment_content");
					break;
				case "singlef":
					b = a(".single_talk .forward_content");
					break;
				case "share":
					b = a("#publish_editor");
					break;
				case "sm":
					b = a("#lb_message .sm_content");
					break;
				case "at_ta":
					b = a("#lb_home_at_ta .at_content");
					break;
				case "lpt":
					b = a(".lbp_box .pub_txt");
					break;
				case "book_rpl":
					b = a("#reply_body .rep_cont");
					break;
				case "dapei_rpl":
					b = a("#reply_body_dapei .rep_cont");
					break;
				case "book_addalbum":
					b = a("#lb_addalbum .album_text");
					break;
				case "follow_add":
					b = a("#lb_album_tuijian .content_test");
					break;
				case "addalbum":
					b = a(this).parents(".content").find(".album_all");
					break;
				case "whisper":
					b = a(".sub_final_stat .sub_text");
					break;
				case "album_rpl":
					b = a(this).parents(".pub_box_all").find(".txt");
					break;
				case "cover_rpl":
					b = a(this).parents(".pub_box").find(".txt");
					break;
				case "acc":
					b = a("#lb_fillalbum .lb_edit_box .cont");
					break;
				case "mg_share":
					b = a(this).parents(".text").find("textarea");
					break;
				case "mg_sharegoods":
					b = a(this).parents(".edit").find("textarea");
					break;
				case "cover_talk":
					b = a(this).parent(".pub_bottom").prev(".pub_content");
					break;
				case "album_talk":
					b = a(this).parent(".pub_bottom").prev(".pub_content");
					break;
				case "group_add":
					b = a(this).parents(".t_follow").find("textarea");
					break;
				case "message_talk":
					b = a(this).parent().prev("textarea");
					break;
				case "book_jia_rpl":
					b = a(this).parents(".reply_box").find("textarea")
			}
			f = setTimeout(function() {
				d.remove()
			}, 3E3);
			d.hover(function() {
				clearTimeout(f);
				d.show()
			}, function() {
				clearTimeout(f);
				f = setTimeout(function() {
					d.remove()
				}, 500)
			})
		});
		a("#lb_face .lb_tab li a").live("click", function() {
			a("#lb_face .lb_tab li").removeClass("c");
			a(this).parent().addClass("c");
			a("#lb_face .lb_bd").html(MGFACE.facePage["f" + a(this).parent().attr("f")])
		});
		a("#lb_face .lb_close").live("click", function() {
			a("#lb_face").remove()
		});
		a("#lb_face .lb_bd li a").live("click", function() {
			var c = b.val();
			b.focus();
			var e = "[" + a(this).parent().attr("title") + "]";
			if (typeof document.selection != "undefined") document.selection.createRange().text = e;
			else {
				var d = b[0].selectionStart;
				b.val(c.substr(0, d) + e + c.substring(d, c.length));
				b[0].setSelectionRange(d + e.length, d + e.length)
			}
			i &&
				(clearTimeout(f), a("#lb_face").show(), f = setTimeout(function() {
					a("#lb_face").remove()
				}, 2E3))
		})
	};
	MOGU.WB_Add_Face_Init()
})(jQuery);
window.Messenger = function() {
	function t(t, e) {
		var i = "";
		if (arguments.length < 2 ? i = "target error - target and name are both requied" : "object" != typeof t ? i = "target error - target itself must be window object" : "string" != typeof e && (i = "target error - target name must be string type"), i) throw new Error(i);
		this.target = t, this.name = e
	}

	function e(t, e) {
		this.targets = {}, this.name = t, this.listenFunc = [], i = e || i, this.initListen()
	}
	var i = "[PROJECT_NAME]",
		a = "postMessage" in window;
	return a ? t.prototype.send = function(t) {
		this.target.postMessage(i + t, "*")
	} : t.prototype.send = function(t) {
		var e = window.navigator[i + this.name];
		"function" == typeof e && e(i + t, window)
	}, e.prototype.addTarget = function(e, i) {
		var a = new t(e, i);
		this.targets[i] = a
	}, e.prototype.initListen = function() {
		var t = this,
			e = function(e) {
				"object" == typeof e && e.data && (e = e.data), e = e.slice(i.length);
				for (var a = 0; a < t.listenFunc.length; a++) t.listenFunc[a](e)
			};
		a ? "addEventListener" in document ? window.addEventListener("message", e, !1) : "attachEvent" in document && window.attachEvent("onmessage", e) : window.navigator[i + this.name] = e
	}, e.prototype.listen = function(t) {
		this.listenFunc.push(t)
	}, e.prototype.clear = function() {
		this.listenFunc = []
	}, e.prototype.send = function(t) {
		var e, i = this.targets;
		for (e in i) i.hasOwnProperty(e) && i[e].send(t)
	}, e
}();
var MOGU = window.MOGU || {};
MOGU.alert = MOGU.alert || function(t) {
	window.alert(t)
}, MOGU.IM_Module = function(t, e, i, a, o, n, r) {
	n = n || (n = MoGu.util);
	var s = "http://www.mogujie.com",
		d = t.ActiveXObject && !t.XMLHttpRequest ? !0 : !1,
		c = {
			style2: {
				width: "82",
				height: "26"
			},
			"default": {
				width: "85",
				height: "24"
			},
			widget1: {
				width: "40",
				height: "55"
			},
			widget2: {
				width: "40",
				height: "55"
			},
			widget3: {
				width: "18",
				height: "22"
			},
			widget4: {
				width: "48",
				height: "20"
			},
			yaya_style: {
				width: "64",
				height: "70"
			},
			xd_style: {
				width: "75",
				height: "25"
			},
			pc: {
				width: "16",
				height: "17"
			}
		},
		l = null,
		m = function(t) {
			for (var e in c)
				if (t.hasClass(e)) return e;
			return null
		},
		u = function(t, e) {
			if (void 0 === e) {
				var i = n.getCookie(t);
				return "" === i ? void 0 : r.parse(i)
			}
			n.setCookie(t, r.stringify(e), {
				expires: 1,
				path: "/"
			})
		},
		p = function(t, e) {
			if (void 0 === e) {
				var i = n.getCookie(t);
				return "" === i ? void 0 : i
			}
			n.setCookie(t, e, {
				expires: 1,
				path: "/"
			})
		},
		h = function(t) {
			var e, a, o, n;
			a = ['<div id="J_im_loadingdom" class="im-waiting">', '<img class="lo_yaya" src="http://s17.mogucdn.com/p1/150927/upload_ieywmy3ege2tsm3fgmzdambqmeyde_92x92.png" width="92" height="92">', '<p class="lo_word J_im_loading_dis"></p>', "</div>"].join(""), e = ['<style id="J_im_loadingstyle">', '.im-waiting{display:none;position:fixed;left:50%;top:50%;margin-left:-66px;margin-top:-66px;width:130px;height:130px;background:#fff;border:1px solid #dcdcdc;z-index:1000;border-radius:8px;box-shadow:0 0 12px rgba(0, 0, 0, .3);_position:absolute;_top:expression(document.compatMode && document.compatMode=="CSS1Compat"?documentElement.scrollTop+documentElement.clientHeight/2:document.body.scrollTop+document.body.clientHeight/2);}', ".im-waiting .lo_yaya{display:block;margin:4px auto 0;}", ".im-waiting .lo_word{color:#f46;text-align:center;font-size:12px;}", "</style>"].join(""), o = i("#J_im_loadingstyle"), o.length <= 0 && i("head").append(e), n = i("#J_im_loadingdom"), n.length <= 0 && (n = i(a), i("body").append(n)), n.find(".J_im_loading_dis").html(t), n.show(300), setTimeout(function() {
				f()
			}, 3e4)
		},
		f = function() {
			i("#J_im_loadingdom").hide(300)
		},
		g = function(t, e, a, n, r) {
			var c, l, m, u, f = /com\/detail\/(1[a-z0-9]+)/;
			c = s + "/mtalk/imv2/", o && o.atc && (c += "?atc=" + o.atc), l = ['<style id="J_imframe_style">', '.im-frame{position:fixed;visibility:hidden;width:569px;height:418px;right:120px;bottom:36px;z-index:1000;_position:absolute;_bottom:auto;_top:expression((document.compatMode && document.compatMode=="CSS1Compat"?documentElement.scrollTop+(documentElement.clientHeight-this.clientHeight):document.body.scrollTop+(document.body.clientHeight-this.clientHeight))-36);}', ".im-closed{right:-600px!important;_right:120px;_display:none;}", ".im-frame-proxy{position:fixed;width:476px;height:28px;right:148px;bottom:401px;z-index:1001;cursor:move;}", ".im-proxy-closed{display:none;}", ".ST_im-frame-proxy-move{background:#EBFAFF;opacity:.8;filter:alpha(opacity=80);}", "html,body{_background-image:url(about:blank);_background-attachment:fixed;}", "</style>"].join(""), m = ['<iframe class="im-frame im-closed" id="J_imframe" src="" allowtransparency="true" scrolling="no" marginwidth="0" marginheight="0" width="569" height="418" frameborder="0"></iframe>'].join(""), u = ['<div class="im-frame-proxy im-proxy-closed" id="J_imframe_proxy"></div>'].join("");
			var g = i("#J_imframe_style");
			g.length <= 0 && i("head").append(l);
			var y = i("#J_imframe"),
				_ = i("#J_imframe_proxy");
			if (y.length <= 0 && (y = i(m), _ = i(u), i("body").append(y), d || i("body").append(_), setTimeout(function() {
					y.css("visibility", "visible")
				}, 1e3), h("正在连接...")), y.hasClass("im-closed") && (y.removeClass("im-closed"), _.removeClass("im-proxy-closed")), t) y.attr("src", c + "#chat/" + t);
			else if (e) {
				e.indexOf("#") < 0 && (e += "#23");
				var w = decodeURIComponent(n).match(f),
					b = "";
				w && w[1] && (b += "/g" + w[1]), y.attr("src", c + "#chat/b" + encodeURIComponent(e) + b)
			} else {
				var v = p("imcuid");
				v = v && v.split("/"), v && "hold" === v[0] && v[1] ? y.attr("src", c + "#chat/" + v[1]) : y.attr("src", c + "#chat")
			}
		},
		y = function(e, a, o, n, d, c, m, p) {
			if ("service" === o) {
				var h, f, y, _, w;
				t.webkitNotifications && 0 !== t.webkitNotifications.checkPermission() && t.webkitNotifications.requestPermission(function() {}), _ = "__mogutalk_boot", w = {
					enable: "true"
				}, e ? (w.uid = e, u(_, w)) : a && (a.indexOf("#") < 0 && (a += "#23"), w.bid = a, u(_, w)), f = u("__mogutalk_life"), y = +new Date, h = Math.abs(y - parseInt(f, 10)), (void 0 === f || h > 4e3) && t.open(s + "/mtalk", "im", "top=50,left=100,width=1000,height=640,location=yes,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no")
			} else if ("cm" === o) {
				var b = {};
				c && "true" === c && (m && (b.sign = m), p && (b._did = p), b.imclient = "1.0"), i.ajax({
					url: "/mtalk/im/calltobusiness",
					data: b,
					type: "POST",
					dataType: "json",
					success: function() {}
				})
			} else self !== top ? l && l.send(r.stringify({
				code: 1001,
				data: {
					uid: e,
					bid: a,
					utype: o,
					refer: n,
					from: d
				}
			})) : g(e, a, o, n, d)
		},
		_ = function() {
			self !== top ? (l = new Messenger("Frame", "ImFrame"), l.addTarget(t.parent, "Parent")) : (l = new Messenger("Parent", "ImFrame"), l.listen(function(t) {
				try {
					switch (t = r.parse(t), t.code) {
						case 1001:
							var e = t.data;
							y(e.uid, e.bid, e.utype, e.refer, e.from);
							break;
						case 1002:
							i("#J_imframe").addClass("im-closed"), i("#J_imframe_proxy").addClass("im-proxy-closed");
							break;
						case 1003:
							i("#J_imframe").remove(), i("#J_imframe_proxy").remove(), f();
							break;
						case 1004:
							i("#J_imframe").removeClass("im-closed"), i("#J_imframe_proxy").removeClass("im-proxy-closed");
							break;
						case 1005:
							a.user_handsome_login_init(), a.user_handsome_login(!1, {
								callback: function() {
									location.reload()
								}
							});
							break;
						case 1006:
							var e = t.data;
							e.msg && a.alert(e.msg);
							break;
						case 1007:
							var e = t.data;
							e && e.msg ? h(e.msg) : f()
					}
				} catch (o) {}
			}))
		},
		w = function() {
			var t = function(t) {
				if (t) {
					var e, a, n, r, d, l, m, u, p, h, f, g, y, _;
					if (e = i(t), a = e.attr("data-style"), m = e.attr("data-bid"), u = e.attr("data-uid"), p = e.attr("data-type"), client = e.attr("data-client"), h = e.attr("data-from"), f = e.html(), y = e.attr("data-sign"), _ = e.attr("data-did"), n = c[a], void 0 !== n && (r = n.width, d = n.height, g = "" === o.userid ? "x" : "√", l = [s + "/mtalk/widget/enterbutton?", "style=", a, "&width=", r, "&height=", d, "&cnt=", encodeURIComponent(f), "&islogin=", encodeURIComponent(g)], u ? (l.push("&uid="), l.push(encodeURIComponent(u))) : m && (l.push("&bid="), l.push(encodeURIComponent(m))), p && (l.push("&type="), l.push(encodeURIComponent(p))), u || m || p)) {
						client && "true" === client && (l.push("&client="), l.push(encodeURIComponent(client)), l.push("&sign="), l.push(encodeURIComponent(y)), l.push("&_did="), l.push(encodeURIComponent(_))), l.push("&from=" + (h || "")), l.push("&refer=" + encodeURIComponent(location.href));
						var w = i('<iframe src="" width="' + r + '" height="' + d + '" frameborder="0" scrolling="no" marginheight="0" allowtransparency="true"></iframe>');
						e.html(w), w.attr("src", l.join(""))
					}
				}
			};
			i(".mogutalk_widget_btn").each(function(e) {
				t(this)
			}), i(e).on("createim:widget", function(e, i) {
				t(i)
			})
		},
		b = function() {
			i(".mogutalk_btn").each(function() {
				var t, e, a, n, r, s, d, c = null,
					l = !1;
				if (t = i(this), c = m(t), null !== c) {
					if (r = t.attr("data-islogin"), (o && "" !== o.userid || r && "√" === r) && (l = !0), a = t.attr("data-uid"), n = t.attr("data-bid"), s = t.attr("data-sign"), d = t.attr("data-did"), e = {}, data_block = {}, e.sign = s, e._did = d, data_block.sign = s, data_block._did = d, a) e.userId = a, data_block.uid = a;
					else {
						if (!n) return;
						n.indexOf("#") < 0 && (n += "#23"), e.shopId = n.split("#")[0], e.type = n.split("#")[1], data_block.bid = n.split("#")[0]
					}
					i.ajax({
						url: "/mtalk/im/customeronline",
						data: e,
						dataType: "json",
						success: function(e) {
							if (e && 1001 === e.status.code) {
								var i = 1 === e.result.isOnline ? !0 : !1;
								i || (t.addClass("mogutalk_btn_offline"), "default" !== c && t.addClass(c + "_offline"))
							}
						}
					}), l && i.ajax({
						url: "/mtalk/user/isblock",
						data: data_block,
						dataType: "json",
						success: function(e) {
							void 0 !== e && 1001 === e.status.code && e.result && e.result.isBlock === !0 && t.addClass("isblock")
						}
					})
				}
			})
		},
		v = function() {
			i(e).on("click", ".mogutalk_btn", function(t) {
				t.preventDefault();
				var e, n, d, c, m, u, p, h, f, g;
				if (e = i(this), n = !1, u = e.attr("data-islogin"), (o && "" !== o.userid || u && "√" === u) && (n = !0), !n) {
					if (o) return a.user_handsome_login_init(), void a.user_handsome_login(!1, {
						callback: function() {
							location.reload()
						}
					});
					if (u) return void(l ? l.send(r.stringify({
						code: 1005
					})) : top.location.href = s + "/login?refer=" + e.attr("data-refer"))
				}
				if (d = e.attr("data-uid"), c = e.attr("data-bid"), m = e.attr("data-type"), h = e.attr("data-refer"), p = e.attr("data-from"), client = e.attr("data-client"), f = e.attr("data-sign"), g = e.attr("data-did"), e.hasClass("isblock")) {
					var _ = "您不能和对方对话～";
					return void(o ? a.alert(_) : l && l.send(r.stringify({
						code: 1006,
						data: {
							msg: _
						}
					})))
				}
				y(d, c, m, h, p, client, f, g)
			}), i(e).on("click", ".duoduo_chat", function(t) {
				t.preventDefault();
				var e = i(this).attr("data-uid");
				i.ajax({
					url: "/mtalk/im/calltotalk",
					data: {
						uid: e
					},
					type: "POST",
					dataType: "json",
					success: function(t) {
						t && t.status ? 1001 === t.status.code ? a.alert("已联系用户，请切换到多多查看！") : 1002010 === t.status.code ? a.alert("请先登录多多！") : a.alert(t.status.msg) : a.alert("网络错误，请稍后再试")
					}
				})
			})
		},
		x = function() {
			var t = {
					startX: 148,
					startY: 401,
					mouseStartX: 0,
					mouseStartY: 0,
					originWidth: 476,
					originHeight: 28,
					width: 569,
					height: 418,
					offsetX: -28,
					offsetY: -365
				},
				a = i("#J_imframe"),
				o = 0,
				n = function() {
					var e = i(".im-frame-proxy");
					e.length <= 0 || (e.animate({
						right: t.startX + t.offsetX + "px",
						bottom: t.startY + t.offsetY + "px"
					}, 100, function() {
						e.css({
							width: t.originWidth + "px",
							height: t.originHeight + "px",
							right: t.startX + "px",
							bottom: t.startY + "px"
						}).removeClass("ST_im-frame-proxy-move")
					}), a.length <= 0 && (a = i("#J_imframe")), a.animate({
						opacity: 1
					}, 100))
				},
				r = function() {
					clearTimeout(o), o = setTimeout(function() {
						n()
					}, 500)
				};
			i(e).on("mousedown", ".im-frame-proxy", function(e) {
				e.preventDefault();
				var o = i(this);
				t.startX = parseInt(o.css("right"), 10), t.startY = parseInt(o.css("bottom"), 10), t.mouseStartX = e.clientX, t.mouseStartY = e.clientY, o.css({
					width: t.width + "px",
					height: t.height + "px",
					right: t.startX + t.offsetX + "px",
					bottom: t.startY + t.offsetY + "px"
				}).addClass("ST_im-frame-proxy-move"), a.length <= 0 && (a = i("#J_imframe")), a.animate({
					opacity: .9
				}, 100), r()
			}).on("mousemove", ".ST_im-frame-proxy-move", function(e) {
				e.preventDefault();
				var a = i(this);
				a.css({
					right: t.startX + (t.mouseStartX - e.clientX) + t.offsetX + "px",
					bottom: t.startY + (t.mouseStartY - e.clientY) + t.offsetY + "px"
				}), r()
			}).on("mouseup", ".im-frame-proxy", function(e) {
				e.preventDefault();
				var n = i(this);
				t.startX = t.startX + (t.mouseStartX - e.clientX), t.startY = t.startY + (t.mouseStartY - e.clientY), n.css({
					width: t.originWidth + "px",
					height: t.originHeight + "px",
					right: t.startX + "px",
					bottom: t.startY + "px"
				}).removeClass("ST_im-frame-proxy-move"), a.length <= 0 && (a = i("#J_imframe")), a.css({
					right: t.startX + t.offsetX + "px",
					bottom: t.startY + t.offsetY + "px"
				}), a.animate({
					opacity: 1
				}, 100), clearTimeout(o)
			})
		};
	return {
		init: function() {
			_(), w(), b(), v(), d || x()
		}
	}
}(window, document, jQuery, window.MOGU, window.MOGUPROFILE, window.MGTOOL, window.JSON), $(document).ready(function() {
	MOGU.IM_Module.init()
});
! function(e) {
	var t = {
		REPORT_URL: "//book.log.juangua.com/mogu.js",
		moduleNames: [],
		imgs: {},
		entrySent: !1,
		leaveSent: !1,
		init: function() {
			this.initTime = this.helper.getNewTime(), this.uuid = this.helper.getCookie("__mgjuuid") + this.initTime;
			for (var e in this.modules) this.registModule(e, this.modules[e]);
			this.addEvent()
		},
		addEvent: function() {
			var e = this;
			window.onbeforeunload = function() {
				var t = parseInt((e.helper.getNewTime() - e.initTime) / 1e3) + "s";
				e.leaveSend([], {
					staytime: t
				}, !1)
			}
		},
		modules: {},
		extend: function(t, n) {
			var i = this.modules[t];
			i ? e.extend(i, n) : this.modules[t] = n, this.registModule(t, n)
		},
		registModule: function(t, n) {
			"function" == typeof n.init && n.init(), -1 == e.inArray(t, this.moduleNames) && (this.moduleNames.push(t), this[t] = n)
		},
		helper: {
			parseTime: function(e) {
				return new Date(parseInt(e)).toLocaleString()
			},
			getNewTime: function() {
				return (new Date).getTime()
			},
			getCookie: function(e) {
				var t, n = new RegExp("(^| )" + e + "=([^;]*)(;|$)");
				return t = document.cookie.match(n), t ? unescape(t[2]) : null
			},
			filter: function(e) {
				return "string" != typeof e ? e : e.replace(/\?|&/gi, "")
			}
		},
		exports: function(t, n) {
			e.isPlainObject(t) ? (n = t, t = this.moduleNames) : t && t.length || (t = this.moduleNames);
			var i, r, o, a = [],
				s = this;
			if (e.each(t, function(t, n) {
					if (i = s.modules[n], !i || "function" != typeof i.exports) return !0;
					var u;
					try {
						if (o = i.exports(), !e.isPlainObject(o)) return !0;
						r = e.map(o, function(e, t) {
							return u = t.indexOf("extra_param") > -1 ? ":" : "=", [s.helper.filter(t), u, s.helper.filter(e)].join("")
						}), a.push(r.join("&"))
					} catch (c) {}
				}), e.isPlainObject(n) && !e.isEmptyObject(n)) {
				var u = e.map(n, function(e, t) {
					return concatSplit = t.indexOf("extra_param") > -1 ? ":" : "=", [s.helper.filter(t), concatSplit, s.helper.filter(e)].join("")
				});
				u.length && a.push(u.join("&"))
			}
			return a.join("&")
		},
		sendLog: function(t, n) {
			var i = this;
			if (t) {
				var r = e.ajax({
					url: i.REPORT_URL,
					method: "get",
					data: n,
					async: !1,
					timeout: 1e3
				});
				r.error(function() {
					r && r.abort()
				})
			} else {
				var o = new Image,
					a = "_img_" + Math.random();
				i.imgs[a] = o, o.onload = o.onerror = function() {
					i.imgs[a] = null
				}, o.src = [i.REPORT_URL, "?", n].join("")
			}
		},
		defaultSend: function(e, t, n) {
			t = t || {};
			var i = this.exports(e, t);
			this.sendLog(n, i)
		},
		entrySend: function(t, n, i) {
			var r = this;
			if (!this.entrySent) {
				this.entrySent = !0, n = n || {}, e.extend(n, {
					uuid: r.uuid,
					action: "entry"
				});
				var o = this.exports(t, n);
				this.sendLog(i, o)
			}
		},
		leaveSend: function(t, n, i) {
			var r = this;
			if (!this.leaveSent) {
				this.leaveSent = !0, n = n || {}, e.extend(n, {
					uuid: r.uuid,
					action: "leave"
				});
				var o = this.exports(t, n);
				this.sendLog(i, o)
			}
		}
	};
	t.init(), MOGU.LogApp = t
}(jQuery),
function(e, t) {
	if (t) {
		var n = {
			url: location.href,
			screenWidth: window.screen.width,
			userAgent: window.navigator.userAgent,
			getPageUrl: function() {
				return this.url.replace(/(\?|\&)/gi, "%")
			},
			getBrowser: function() {
				var e = {};
				if ("object" != typeof navigator || "string" != typeof navigator.userAgent) return "others";
				var t = navigator.userAgent.toLowerCase();
				if (!t || "" == t || "string" != typeof t) return "others";
				var n;
				return (n = t.match(/msie ([\d.]+)/i)) ? e.ie = n[1] : (n = t.match(/chrome\/([\d.]+)/i)) ? e.chrome = n[1] : (n = t.match(/firefox\/([\d.]+)/i)) ? e.firefox = n[1] : (n = t.match(/opera.([\d.]+)/i)) ? e.opera = n[1] : (n = t.match(/version\/([\d.]+).*safari/i)) ? e.safari = n[1] : 0, e.ie ? "IE: " + e.ie : e.firefox ? "Firefox: " + e.firefox : e.chrome ? "Chrome: " + e.chrome : e.opera ? "Opera: " + e.opera : e.safari ? "Safari: " + e.safari : "others"
			},
			exports: function() {
				var e = this;
				return {
					pageurl: e.getPageUrl(),
					screenwidth: e.screenWidth,
					browser: e.getBrowser()
				}
			}
		};
		t.extend("ClientInfo", n)
	}
}(jQuery, MOGU.LogApp),
function(e, t) {
	if (t) {
		var n = {
			errors: [],
			init: function() {
				this.addEvent()
			},
			addEvent: function() {
				var e = this;
				window.onerror = function(t, n, i) {
					e.errors.push({
						msg: t,
						line: i
					})
				}
			},
			exports: function() {
				var t, n = [];
				return e.each(this.errors, function(e, i) {
					t = [i.msg, "@line", i.line].join(""), n.push(t)
				}), {
					errors: n.join(",")
				}
			}
		};
		t.extend("PageError", n)
	}
}(jQuery, MOGU.LogApp),
function(e, t) {
	if (t && 0 !== location.protocol.indexOf("https")) {
		var n = {
			cdnUrl: ".mogujie.cn/pic/140515/嘉年华(3)_kqzg4ykel5bdkrlwgfjeg5sckzsew_600x291.jpg",
			testCdn: ["s13", "s6", "s12", "s7"],
			timeArr: [],
			init: function() {
				this.addEvent()
			},
			addEvent: function() {
				var n = this;
				e(function() {
					e.each(n.testCdn, function(i, r) {
						var o = new Image,
							a = t.helper.getNewTime();
						e(o).load(function() {
							n.timeArr.push(t.helper.getNewTime() - a)
						}).attr("src", "http://" + r + n.cdnUrl)
					})
				})
			},
			exports: function() {
				var t = [],
					n = this;
				return e.each(n.testCdn, function(e, i) {
					t.push(i + ":" + (n.timeArr[e] || 0) + "ms")
				}), {
					netspeed: t.join(",")
				}
			}
		};
		t.extend("NetSpeed", n)
	}
}(jQuery, MOGU.LogApp),
function(e, t) {
	if (t && window.performance) {
		var n = {
			timing: window.performance.timing,
			blankTime: 0,
			readyTime: 0,
			onloadTime: 0,
			setData: function() {
				var e = this,
					t = e.timing.domainLookupStart;
				e.blankTime = (window.__trace__headendt || 0) - t, e.readyTime = e.timing.domInteractive - t, e.onloadTime = e.timing.domComplete - t
			},
			exports: function() {
				var e = this;
				return e.setData(), {
					pfm: ["b:" + e.blankTime, "r:" + e.readyTime, "o:" + e.onloadTime].join(",")
				}
			}
		};
		t.extend("Performance", n)
	}
}(jQuery, MOGU.LogApp),
function(e, t) {
	t && e(window).on("load", function() {
		t.defaultSend(["ClientInfo", "PageError", "NetSpeed", "Performance"], {
			_: +new Date
		}, !1)
	})
}(jQuery, MOGU.LogApp);
var MOGU = window.MOGU || {};
! function(t, n) {
	var e = {};
	e.Util = {
		mask: function() {
			var n = t(".light_box_fullbg");
			n.length <= 0 && (n = t(['<div class="light_box_fullbg"></div>'].join("")), t("body").append(n))
		},
		show: function(n, e) {
			var l, i, c, o = t("#vp_wrap"),
				a = t(".light_box_fullbg").eq(0);
			o.length <= 0 && (o = t(['<div class="vp_wrap" id="vp_wrap">', '<h5 class="vp_t"></h5>', '<a href="javascript:;" class="vp_cls">×</a>', '<div class="v_pop_box"></div>', "</div>"].join("")), t("body").append(o), a.off("click").on("click", function() {
				clearTimeout(c), o.addClass("vp_shake"), c = setTimeout(function() {
					o.removeClass("vp_shake")
				}, 500)
			})), o.find(".vp_t").html(e.title), i = {
				alert: function() {
					return l = t(".vp_alert"), l.length <= 0 && (l = t(['<div class="vp_alert vp_inner">', '<p class="vp_cnt"></p>', '<a href="javascript:;" class="vp_btn vp_btn_' + e.btn.theme + ' vp_ok">' + e.btn.text + "</a>", "</div>"].join(""))), l.show().find(".vp_cnt").html(e.content), l
				},
				confirm: function() {
					return l = t(".vp_cfm"), l.length <= 0 && (l = t(['<div class="vp_cfm vp_inner">', '<p class="vp_cnt"></p>', '<a href="javascript:;" class="vp_btn vp_btn_' + e.btn1.theme + ' vp_ok">' + e.btn1.text + "</a>", '<a href="javascript:;" class="vp_btn vp_btn_' + e.btn2.theme + ' vp_cancel">' + e.btn2.text + "</a>", "</div>"].join(""))), l.show().find(".vp_cnt").html(e.content), l
				}
			}, o.find(".v_pop_box").append(i[n]()), o.css({
				display: "block",
				opacity: 0
			}).css({
				"margin-left": -o.width() / 2 - 1,
				"margin-top": -o.height() / 2 - 1,
				opacity: 1
			}), a.show()
		},
		close: function(n, e) {
			t(".light_box_fullbg").eq(0).hide(), t("#vp_wrap").find(".vp_inner").hide().end().hide(), void 0 !== e && "function" == typeof e && e(n)
		}
	}, t.alert = function(n, l, i) {
		var c = t.extend(!0, {
				title: "提示",
				content: n,
				btn: {
					text: "确定",
					theme: "red",
					val: void 0
				},
				close_val: void 0
			}, i),
			o = function() {
				t("#vp_wrap").off("click").on("click", ".vp_ok", function(t) {
					t.preventDefault(), e.Util.close(c.btn.val, l)
				}).on("click", ".vp_cls", function(t) {
					t.preventDefault(), e.Util.close(c.close_val, l)
				})
			};
		! function() {
			e.Util.mask(), e.Util.show("alert", c), o()
		}()
	}, t.confirm = function(n, l, i) {
		var c = t.extend(!0, {
				title: "提示",
				content: n,
				btn1: {
					text: "确定",
					theme: "red",
					val: !0
				},
				btn2: {
					text: "取消",
					theme: "normal",
					val: !1
				},
				close_val: !1
			}, i),
			o = function() {
				t("#vp_wrap").off("click").on("click", ".vp_ok", function(t) {
					t.preventDefault(), e.Util.close(c.btn1.val, l)
				}).on("click", ".vp_cancel", function(t) {
					t.preventDefault(), e.Util.close(c.btn2.val, l)
				}).on("click", ".vp_cls", function(t) {
					t.preventDefault(), e.Util.close(c.close_val, l)
				})
			};
		! function() {
			e.Util.mask(), e.Util.show("confirm", c), o()
		}()
	}, n.MOGU.alert = t.alert, n.MOGU.confirm = t.confirm
}(jQuery, window);
! function(a) {
	MOGU.Publish_Imgs_Init = function(c, d) {
		a("#lb_publish_box .add_file").pubimg({
			callback: function(e, f, g, h, i) {
				c.close();
				var j = {
						title: "我要分享",
						lightBoxId: "lb_publish_imgs",
						scroll: !1,
						ajax: !0,
						isBgClickClose: !1
					},
					k = new MGLightBox(j);
				k.init();
				var l = {
					imgId: g,
					path: h
				};
				d = i.attr("tab") ? {
					tab: i.attr("tab")
				} : d, d && d.isdapeiroom && (l = {
					imgId: g,
					path: h,
					isdapeiroom: 1,
					roomTitle: d.roomTitle
				});
				a.ajax({
					url: "/twitter/imgpubview",
					type: "POST",
					timeout: 6e4,
					data: l,
					dataType: "json",
					success: function(c) {
						if (null == c || "" == c) alert(MGLANG.msgTimeout);
						else {
							var e = c.status.code,
								f = c.status.msg;
							if (1001 == e) {
								var h = c.result.data.html;
								if (k.buildContent(h), d && d.albumId && a("#lb_publish_imgs .chose_album").hide(), MOGU.Globe_Input_Text_Hide(a(".pub_box_op .pub_txt")), MOGU.Globe_Input_Text_Hide(a(".pub_addlink .addlink_con")), b(), "0" == MOGUPROFILE.is_subsite) var i = 140;
								else var i = 300;
								MOGU.WB_Word_Count("lb_publish_imgs", "pub_content_img", i);
								var j = {
									img_limit: 8,
									pub_img_content: a(".pub_img_content"),
									up_another_div: a(".pub_img_content .up_another"),
									up_default_div: a(".pub_img_content .default")
								};
								a(".pub_img_content").data("img_array", g + ","), MOGU.Img_Pub_Widget(j), a("#pub_content_img").focus(function() {
									a(".pub_img_content .word_count_wrap").show()
								}).blur(function() {
									a(".pub_img_content .word_count_wrap").hide()
								}), a("#lb_publish_imgs .pub_submit").click(function() {
									var b = a(".pub_img_content").data("img_array"),
										c = a("#lb_publish_imgs"),
										e = c.find(".pub_out input").prop("checked"),
										f = c.find(".pub_txt"),
										g = f.val();
									g = f.attr("def-v") == g ? "" : g;
									var h = MGTOOL.getMsgLength(a.trim(g));
									if (h > i) return alert("最多可以输入" + i + "个字，您输入得太多了。"), !1;
									var j = c.find(".choose").data("albumid"),
										l = {
											content: g,
											imgIds: b,
											albumId: j,
											sync: e,
											local: MOGUPROFILE.local
										};
									if (d)
										for (var m in d) "undefined" != typeof d[m] && (l[m] = d[m]);
									if ("undefined" == typeof l.albumId) {
										if (j = c.find(".choose").attr("albumid"), "undefined" == typeof j) return alert("你还未选择专辑"), !1;
										l.albumId = j
									}
									l.imageGoods = [], a(".pub_link_list .link_item").each(function() {
										l.imageGoods.push(a(this).data("imageGoods"))
									});
									var n = {
										data: l,
										succ_cb: function(b, c) {
											d ? d.albumId ? (k.success_close("发表成功！"), "true" == d.reload && setTimeout(function() {
												window.location.reload()
											}, 1e3)) : d.starId ? k.success_close('发表成功，请等待审核！ <a href="/album/show/' + j + '" class="to_see">去看看</a>', 2e3) : 1 == d.isdapeiroom && 0 == d.pictureType ? (a("#try_apply .twitterid").val(c.result.twitterId), a(".apply_step1 .dapei_upimg").html('<img src="' + c.result.imgUrl + '" />'), k.success_close("发表成功！", 1e3)) : 1 == d.isdapeiroom && 1 == d.pictureType ? window.location.href = window.location.href : k.success_close('发表成功！ <a href="/album/show/' + j + '" class="to_see">去看看</a>', 2e3) : k.success_close('发表成功！ <a href="/album/show/' + j + '" class="to_see">去看看</a>', 2e3), a(".pub_img_content").data("img_array", "")
										},
										fail_cb: function() {
											k.fail('发表失败！ <a href="javascript:;" class="try_again">再试一次</a>'), a(".pub_img_content").data("img_array", "")
										}
									};
									MOGU.Publish_Pub_Submit(n)
								})
							} else alert(f)
						}
					},
					error: function(a, b) {
						"timeout" == b && alert(MGLANG.msgTimeout)
					},
					complete: function() {}
				})
			}
		})
	};
	var b = function() {
		a(".pub_addlink .addlink_btn").bind("click", function() {
			var b = a.trim(a(".pub_addlink .addlink_con").val()),
				c = a(".pub_addlink .addlink_con").attr("def-v");
			return "" == b || b == c ? (alert("请填写商品地址"), !1) : MOGU.Globe_Goods_URL_Support(b) ? a(".pub_addlink .pub_link_list li").size() >= 6 ? (alert("最多只能添加6个相关链接哦！"), !1) : (a.ajax({
				url: "/twitter/goodsinfo",
				type: "POST",
				timeout: 6e4,
				data: {
					url: b,
					type: 1
				},
				dataType: "json",
				success: function(b) {
					if (null == b || "" == b) alert(MGLANG.msgTimeout), goods_frame.remove();
					else {
						var c = b.status.code,
							d = b.status.msg;
						if (1001 == c) {
							var e = b.result.data.detail,
								f = e.num_id,
								g = e.shop_seller,
								f = e.num_id,
								h = e.from,
								i = e.iid,
								j = ".link_item_" + f + "_" + h + "_" + i;
							if (a(".pub_link_list " + j).size() > 0) return alert("不能添加相同的商品"), void 0;
							var k = b.result.data.html,
								l = a(".pub_addlink .pub_link_list li").size() + 1;
							a(".pub_link_list").show(), a(".pub_link_list").append(k.replace(/{num}/g, l));
							var m = a(".pub_link_list " + j);
							m.data("imageGoods", e);
							var n = "还可添加" + (6 - l) + "条链接";
							6 == l && (n = "最多只能添加6个相关链接哦！"), a(".pub_addlink .addlink_con").val(n).attr("def-v", n).css({
								color: "#ccc"
							});
							var o = 0;
							a(".pub_link_list .link_item").each(function(b, c) {
								a(c).attr("shop") == g && o++
							}), o >= 3 && a(".pub_addlink .error").show()
						} else alert(d)
					}
				}
			}), void 0) : (alert("请填写正确的商品地址"), !1)
		}), a(".pub_link_list .link_item .del").live("click", function() {
			var b = 0,
				c = a(this).parents(".link_item"),
				d = c.attr("shop");
			MGTOOL.log(d), a(".pub_link_list .link_item").each(function(c, e) {
				a(e).attr("shop") == d && b++
			}), c.remove(), a(".pub_link_list .link_item").each(function(b, c) {
				a(c).find(".num").html(b + 1)
			});
			var e = a(".pub_link_list .link_item").size();
			0 == e && a(".pub_link_list").hide();
			var f = "还可添加" + (6 - e) + "条链接";
			a(".pub_addlink .addlink_con").val(f).attr("def-v", f).css({
				color: "#ccc"
			}), 3 == b && a(".pub_addlink .error").hide()
		})
	};
	MOGU.Publish_Goods_Init = function(a, b) {
		var c = ['<div class="pub_goods_url clearfix">', '<div class="clearfix">', '<input class="g_url fl" type="text" value="将商品网址粘贴到这里" placeholder="将商品网址粘贴到这里">', '<input class="g_s fl" value="确定" type="button">', "</div>", '<div class="support_site">', '<span class="title">已支持以下网站</span>', '<p class="support_list">', '<a href="http://www.taobao.com/" target="_blank">淘宝</a>', '<a href="http://www.paipai.com/" target="_blank">拍拍</a>', '<a href="http://www.dangdang.com/" target="_blank">当当</a>', '<a href="http://www.vancl.com/" target="_blank">凡客</a>', '<a href="http://www.360buy.com/" target="_blank">京东</a>', '<a href="http://www.topshop.com/" target="_blank">Topshop</a>', '<a href="http://buy.caomeipai.com/" target="_blank">草莓派</a>', '<a href="http://www.mbaobao.com/" target="_blank">麦包包</a>', '<a href="http://www.nala.com.cn/" target="_blank">NALA</a>', '<a href="http://www.maymay.cn/" target="_blank">Maymay</a>', '<a href="http://www.asos.com/" target="_blank">asos</a>', '<a href="http://www.100f1.com/" target="_blank">我的百分之一</a>', '<a href="http://www.51yugou.com/" target="_blank">稀品网</a>', '<a href="http://www.rosebeauty.com.cn/" target="_blank">玫瑰社区</a>', '<a href="http://cn.shopbop.com/" target="_blank">SHOPBOP</a>', "</p>", "</div>", "</div>"].join("");
		a.buildContent(c), MOGU.Publish_Goods_Func(a, b)
	}, MOGU.Publish_Goods_Func = function(b, c) {
		var d = a("#lb_publish_box");
		MOGU.Globe_Input_Text(d.find(".g_url")), d.find(".g_s").click(function() {
			b.close();
			var e = a(this);
			if (1 != e.data("isSubmit")) {
				var f = MGTOOL.trim(d.find(".g_url").val());
				if ("" == f) return alert("请填写商品地址"), !1;
				if (!MOGU.Globe_Goods_URL_Support(f)) return alert("请填写正确的商品地址"), !1;
				var g = {
						title: "我要分享",
						lightBoxId: "lb_publish_goods",
						scroll: !1,
						ajax: !0,
						isBgClickClose: !1
					},
					h = new MGLightBox(g);
				h.init(), e.data("isSubmit", 1), getGoodInfo = a.ajax({
					url: "/twitter/goodsinfo",
					type: "POST",
					timeout: 6e4,
					data: {
						url: f
					},
					dataType: "json",
					success: function(b) {
						if (null == b || "" == b) alert(MGLANG.msgTimeout), d.remove();
						else {
							var e = b.status.code,
								f = b.status.msg;
							if (1001 == e) {
								var g = b.result.data.detail,
									i = g.num_id;
								MOGU.WB_Goods_Array = {}, MOGU.WB_Goods_Array[i] = g;
								var j = b.result.data.html;
								h.buildContent(j), MOGU.WB_Word_Count("lb_publish_goods", "pub_content_goods", 140), MOGU.Globe_Input_Text_Hide(a(".pub_box_op .pub_txt")), c && c.albumId && a("#lb_publish_goods .chose_album").hide(), a("#lb_publish_goods .pub_submit").click(function() {
									var b = a("#lb_publish_goods"),
										d = b.find(".pub_out input").prop("checked"),
										e = b.find(".pub_txt"),
										f = e.val(),
										g = "/twitter/newtwitter";
									f = e.attr("def-v") == f ? "" : f;
									var i = MGTOOL.getMsgLength(a.trim(f));
									if (i > 140) return alert("最多可以输入140个字，您输入得太多了。"), !1;
									var j = b.find(".choose").data("albumid"),
										k = {
											content: f,
											albumId: j,
											goods: MGTOOL.objToJson(MOGU.WB_Goods_Array),
											sync: d,
											local: MOGUPROFILE.local
										};
									if (c)
										for (var l in c) "undefined" != typeof c[l] && (k[l] = c[l]);
									if ("undefined" == typeof k.albumId) {
										if (j = b.find(".choose").attr("albumid"), "undefined" == typeof j) return alert("你还未选择专辑"), !1;
										k.albumId = j
									}
									k.url && k.url.length > 0 && (g = k.url);
									var m = {
										data: k,
										url: g,
										succ_cb: function() {
											c ? (c.albumId && h.success_close("发表成功"), "true" == c.reload && setTimeout(function() {
												window.location.reload()
											}, 1e3)) : h.success_close('发表成功！ <a href="/album/show/' + j + '" class="to_see">去看看</a>', 2e3), MOGU.WB_Goods_Array = {}
										},
										fail_cb: function() {
											h.fail('发表失败！ <a href="javascript:;" class="try_again">再试一次</a>'), MOGU.WB_Goods_Array = {}
										}
									};
									MOGU.Publish_Pub_Submit(m)
								})
							} else alert(f), d.remove()
						}
					},
					error: function(a, b) {
						"timeout" == b && alert(MGLANG.msgTimeout)
					},
					complete: function() {
						e.removeData("isSubmit")
					}
				})
			}
		})
	}, MOGU.Publish_Pub_Submit = function(b) {
		var c = {
				url: "/twitter/newtwitter",
				data: {},
				pub_btn: a(".pub_submit"),
				succ_cb: function() {},
				fail_cb: function() {}
			},
			d = a.extend(c, b);
		if (1 != d.pub_btn.data("isSubmit")) {
			var e = d.data;
			e._fk = 1, a.ajax({
				url: d.url,
				type: "POST",
				timeout: 6e4,
				data: e,
				dataType: "json",
				beforeSend: function() {
					d.pub_btn.data("isSubmit", 1)
				},
				success: function(a) {
					if (null == a || "" == a) alert(MGLANG.msgTimeout);
					else {
						var b = a.status;
						if (void 0 == b || null == b) return alert(MGLANG.msgTimeout), void 0;
						var c = b.code,
							e = b.msg;
						1001 == c ? d.succ_cb(b, a) : 2710 == c ? alert(e) : (d.fail_cb(b, a), alert(e))
					}
				},
				error: function(a, b) {
					"timeout" == b && alert(MGLANG.msgTimeout)
				},
				complete: function() {
					d.pub_btn.removeData("isSubmit")
				}
			})
		}
	}, MOGU.Publish_Pub_Box_Init = function(b) {
		var c = "1" == MOGUPROFILE.is_subsite ? "上传美图" : "上传你的搭配晒货照",
			d = ['<div class="pub_chose clearfix">', '<a href="javascript:;" class="chose_goods chose_type r5">', "<b></b>", "<p>商品</p>", "<span>输入网购商品的链接</span>", "</a>", '<a href="javascript:;" class="chose_pic chose_type r5">', '<div class="up_pic_wrap">', '<form action="/upload/addpic" method="post" enctype="multipart/form-data" target="ifr_picup" class="add_pic_form">', '<input type="hidden" id="coverImgId" value="">', '<input type="file" hidefocus="true" id="upload_img" name="image" class="add_file">', "</form>", "</div>", "<b></b>", "<p>照片</p>", "<span>" + c + "</span>", "</a>", "</div>"].join(""),
			e = {
				title: "我要分享",
				lightBoxId: "lb_publish_box",
				scroll: !1,
				contentHtml: d,
				isBgClickClose: !1,
				type: "default"
			},
			f = new MGLightBox(e);
		f.init(), a("#lb_publish_box .chose_goods").click(function() {
			MOGU.Publish_Goods_Init(f, b)
		}), MOGU.Publish_Imgs_Init(f, b)
	}, MOGU.Home_Pub_Face = function() {
		a(".pub_box_op .add_face_new").live("click", function() {
			var b = a(this).parents(".pub_box_op").find(".pub_txt"),
				c = {
					click_obj: a(this),
					output: b
				},
				d = new MOGU.WB_Add_Face_Init_New(c);
			d.init()
		})
	}, MOGU.Home_Pub_Face()
}(jQuery);
MOGU.Publish_Pub_Box_Init_Daren = function(a) {
	var b = ("1" == MOGUPROFILE.is_subsite ? "上传美图" : "上传你的搭配晒货照", ['<div class="publish_img">', '<div class="publish_wrap clearfix">', '<div class="dapei item">', '<a href="javascript:;" class="upload_wrap">', '<div class="upload_file">', '<form action="/upload/addpic" method="post" enctype="multipart/form-data" target="ifr_picup" class="add_pic_form">', '<input type="hidden" id="coverImgId" value="">', '<input type="file" hidefocus="true" name="image" class="add_file" tab="4">', "</form>", "</div>", '<div class="upload_box">', '<img src="http://s8.mogujie.cn/pic/131022/sp1ku_kqywm3c2kfbegrlwgfjeg5sckzsew_98x98.jpg">', "</div>", '<div class="upload_btn">', "</div>", "</a>", "</div>", '<div class="look item">', '<a href="javascript:;" class="upload_wrap">', '<div class="upload_file">', '<form action="/upload/addpic" method="post" enctype="multipart/form-data" target="ifr_picup" class="add_pic_form">', '<input type="hidden" id="coverImgId" value="">', '<input type="file" hidefocus="true" name="image" class="add_file" tab="3">', "</form>", "</div>", '<div class="upload_box">', '<img src="http://s6.mogujie.cn/pic/131022/sp1ku_kqywomlckfbfiq2ugfjeg5sckzsew_98x98.jpg">', "</div>", '<div class="upload_btn">', "</div>", "</a>", "</div>", '<div class="other item">', '<a href="javascript:;" class="upload_wrap">', '<div class="upload_file">', '<form action="/upload/addpic" method="post" enctype="multipart/form-data" target="ifr_picup" class="add_pic_form">', '<input type="hidden" id="coverImgId" value="">', '<input type="file" hidefocus="true" name="image" class="add_file">', "</form>", "</div>", '<div class="upload_box">', '<img src="http://s6.mogujie.cn/pic/131022/sp1ku_kqyvo4kfkfbegq2ugfjeg5sckzsew_98x98.jpg">', "</div>", '<div class="upload_btn">', "</div>", "</a>", "</div>", "</div>", "</div>"].join("")),
		c = {
			title: '分享照片<b style="margin-left:20px;font-size:12px;color:#ff3b60">选择对应的分类，被精彩的概率会更高哦</b><a href="http://www.mogujie.com/group/topic/1z14w" target="_blank" class="publish_img_share" style="position: absolute; top: -25px; right: 17px; width: 120px; height: 88px; overflow: hidden; text-indent: -999em; background: url(http://s12.mogujie.cn/pic/140516/未标题-1_kq2eeutykrbhm2cugfjeg5sckzsew_120x88.png) no-repeat; _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=\'scale\',src=\'http://s12.mogujie.cn/pic/140516/未标题-1_kq2eeutykrbhm2cugfjeg5sckzsew_120x88.png\'); _background-image: none;">分享得佣金</a>',
			lightBoxId: "lb_publish_box",
			scroll: !1,
			contentHtml: b,
			isBgClickClose: !1,
			type: "default"
		},
		d = new MGLightBox(c);
	d.init(), $("#lb_publish_box .chose_goods").click(function() {
		MOGU.Publish_Goods_Init(d, a)
	}), MOGU.Publish_Imgs_Init(d, a)
};
! function(a) {
	MGTEMPLATE.at_ta = '<div class="at_pub_area"><div class="atpa_tool"><a href="javascript:;"><img src="/img/add_face_c.png" w="at_ta" style="margin-top:5px" class="fl add_face"></a><span class="at_count">还可以输入<b>140</b>字</span></div><textarea class="at_content"></textarea><div class="at_submit_box"><a class="at_submit" href="javascript:;">发   送</a><a href="javascript:;" class="at_cancel">取消</a></div></div>', MGTEMPLATE.sendMessage = '<div class="sm_pub_area"><div class="smpa_tool"><a href="javascript:;"><img src="/img/add_face_c.png" w="sm" style="margin-top:5px" class="fl add_face"></a><span class="sm_count">说明：长度不超过400字</span></div><textarea class="sm_content"></textarea><div class="sm_submit_box"><a class="sm_submit" href="javascript:;">发   送</a><a href="javascript:;" class="sm_cancel">取消</a></div></div>', MOGU.send_message_init = function() {
		var b = "",
			c = null;
		a(".send_message").die("click").live("click", function() {
			b = a(this).attr("toid"), a.ajax({
				url: "/collect/isinblacklist",
				type: "POST",
				data: {
					blacklistid: b
				},
				dataType: "json",
				success: function(d) {
					if (null == d) alert(MGLANG.msgTimeout);
					else {
						var e = d.status.code,
							f = d.status.msg;
						if (1001 == e) {
							var g = d.result.inblacklist;
							if (1 == g) return alert("由于对方的隐私设置，你暂时还不能给她发私信"), !1;
							var h = {
								title: "发私信",
								lightBoxId: "lb_message",
								contentHtml: MGTEMPLATE.sendMessage,
								scroll: !0
							};
							if (a("#lb_message").size() > 0) return !1;
							c = new MGLightBox(h), c.init(), a(".sm_submit").unbind("click").bind("click", function() {
								var d = a("#lb_message .sm_content").val();
								MOGU.send_msessage(b, d, c)
							}), a(".sm_cancel").unbind("click").bind("click", function() {
								c.close()
							})
						} else alert(f)
					}
				}
			})
		})
	}, MOGU.send_msessage = function(b, c, d) {
		var e = {
			message_toId: b,
			message_content: c
		};
		a.ajax({
			url: "/message/ajaxsend",
			type: "POST",
			data: e,
			dataType: "json",
			success: function(a) {
				if (null == a) alert(MGLANG.msgTimeout);
				else {
					var b = a.status.code,
						c = a.status.msg;
					1001 == b ? d.success_close("发送成功！", 500) : 6002 == b ? alert(c) : alert(c)
				}
			}
		})
	}, MOGU.home_home_at_ta_init = function() {
		a(".home_at_ta").live("click", function() {
			var b = a(this),
				c = b.attr("toid"),
				d = b.attr("title") || "有什么想对她说的？";
			a.ajax({
				url: "/collect/isinblacklist",
				type: "POST",
				data: {
					blacklistid: c
				},
				dataType: "json",
				success: function(c) {
					if (null == c) alert(MGLANG.msgTimeout);
					else {
						var e = c.status.code,
							f = c.status.msg;
						if (1001 == e) {
							var g = c.result.inblacklist;
							if (1 == g) return alert("由于对方的隐私设置，你暂时还不能@她"), !1;
							var h = {
								title: d,
								lightBoxId: "lb_home_at_ta",
								contentHtml: MGTEMPLATE.at_ta,
								scroll: !0
							};
							if (a("#lb_home_at_ta").size() > 0) return !1;
							var i = new MGLightBox(h);
							i.init();
							var j = b.attr("toname");
							a("#lb_home_at_ta .at_content").val("@" + j + ": ");
							var k = a("#lb_home_at_ta"),
								l = k.find(".at_content"),
								m = l.val().length;
							if (l[0])
								if (l[0].createTextRange) {
									var n = l[0].createTextRange();
									n.moveEnd("character", m), n.moveStart("character", m), n.select()
								} else l[0].setSelectionRange(m, m), l.focus();
							var o = function() {
								var a = MGTOOL.getMsgLength(l.val()),
									b = k.find(".at_count b");
								0 == a ? (b.text(140), b.css("color", "#690")) : (b.text(140 - a), a > 140 ? b.css("color", "#F92D09") : b.css("color", "#690"))
							};
							o(), l.bind("keyup", o).bind("input", o).bind("propertychange", o), a(".at_submit").click(function() {
								MOGU.home_at_ta(l.val(), i)
							}), a(".at_cancel").click(function() {
								a("#lb_home_at_ta,.light_box_fullbg").remove()
							})
						} else alert(f)
					}
				}
			})
		})
	}, MOGU.home_at_ta = function(b, c) {
		a.ajax({
			url: "/twitter/newtwitter",
			type: "POST",
			data: {
				content: b,
				_fk: 1
			},
			dataType: "json",
			success: function(a) {
				if (null == a) alert(MGLANG.msgTimeout);
				else {
					var b = a.status.code,
						d = a.status.msg;
					1001 == b ? c.success_close("发送成功！", 500) : 6002 == b ? alert(d) : alert(d)
				}
			}
		})
	}, MOGU.send_message_init(), MOGU.home_home_at_ta_init()
}(jQuery);
$(function() {
		var e = $(".header_2015"),
			t = $(".mgj_rightbar");
		t.hide();
		var o = {};
		o.View = {
			init: function() {
				this.addEvent()
			},
			addEvent: function() {
				var e = this;
				$("body").on("cinfodatarecieve", function(t, o) {
					if (o) {
						var r = o,
							n = {};
						n.twitterNew = parseInt(r.cmessageNew), n.catmeNew = parseInt(r.a), n.cfavedNew = parseInt(r.b), n.cmsgNew = parseInt(r.c), n.fansNew = parseInt(r.d), n.csysmsgNew = parseInt(r.e), n.cactiveNew = parseInt(r.f), n.intelligent = parseInt(r.g), n.ccartNew = parseInt(r.h), n.chatNew = parseInt(r.i), $.each(e.renders, function(e, t) {
							$.isFunction(t) && t(n)
						})
					}
				})
			},
			renders: {
				renderShopCart: function(t) {
					var o = e.find(".shopping_cart_v2");
					if (o.length) {
						try {
							t.ccartNew = +t.ccartNew
						} catch (r) {}
						o.find(".cart_info b").text(t.ccartNew > 99 ? "99+" : t.ccartNew)
					}
				},
				renderNavCart: function(t) {
					var o = e.find(".shopping_cart_v2");
					o.length && (t.ccartNew ? o.find(".num").html(t.ccartNew > 99 ? "99+" : t.ccartNew).show() : o.find(".num").hide())
				},
				renderSideBarCart: function(e) {
					var o = t.find(".shopping_cart");
					o.length && (e.ccartNew ? o.find(".num").html(e.ccartNew).show() : o.find(".num").hide())
				},
				renderSideBarCoupon: function(e) {
					var o = t.find(".shopping_coupon");
					o.length && (e.ccartNew ? o.find(".num").html(e.ccartNew > 99 ? "99+" : e.ccartNew).show() : o.find(".num").hide())
				},
				renderNavMsg: function(t) {
					var o = e.find(".mogutalk_btn");
					o.length && (t.chatNew ? o.find(".num").html(t.chatNew > 99 ? "99+" : t.chatNew).show() : o.find(".num").hide())
				}
			}
		}, o.View.init();
		var r = function() {
			this.highClassName = "s1_on"
		};
		r.prototype = {
			add2Collection: function(e) {
				$.browser.msie && 6 == $.browser.version && $.isPlainObject(e) && e.wrap.length && e.target && this._registerEvent(e)
			},
			_registerEvent: function(e) {
				var t = this;
				e.wrap.on("mouseenter", e.target, function(e) {
					$(this).addClass(t.highClassName).siblings().removeClass(t.highClassName)
				}), e.wrap.on("mouseleave", e.target, function(e) {
					$(this).removeClass(t.highClassName)
				})
			}
		}, (new r).add2Collection({
			wrap: $(".header_top"),
			target: ".s1"
		})
	}),
	function() {
		var e, t;
		$(document).on("ready", function(o) {
			var r = $(window).width();
			t = $(window).height(), 1212 > r ? (e = !0, $(".mgj_rightbar_960").animate({
				right: "-30px"
			}, 200), $("#mgj_rightbar_icon1_border").removeClass("border_common")) : e = !1;
			var n = .1 * t,
				a = .05 * t;
			$("#mgj_rightbar_blank_div").css("margin-top", n), $("#mgj_rightbar_back2top").css("bottom", a), $("#mgj_rightbar_feedback").css("bottom", a + 35)
		}), $(window).on("resize", function(o) {
			var r = $(window).width();
			t = $(window).height(), 1212 > r && !e ? (e = !0, $(".mgj_rightbar_960").animate({
				right: "-30px"
			}, 500), $("#mgj_rightbar_icon1_border").removeClass("border_common")) : r >= 1212 && e && (e = !1, $(".mgj_rightbar_960").animate({
				right: "0px"
			}, 500), $("#mgj_rightbar_icon1_border").addClass("border_common"));
			var n = .1 * t,
				a = .05 * t;
			$("#mgj_rightbar_blank_div").css("margin-top", n), $("#mgj_rightbar_back2top").css("bottom", a), $("#mgj_rightbar_feedback").css("bottom", a + 35)
		}), $("#mgj_rightbar_icon1").on("mouseover", function() {
			$(this).removeClass("icon_change_before"), $(this).addClass("icon_change_after"), $("#mgj_rightbar_icon1_count").removeClass("count_bg_before").addClass("count_bg_after"), $("#mgj_rightbar_icon1_border").removeClass("border_common").addClass("border_common_mouseover")
		}).on("mouseout", function() {
			$(this).addClass("icon_change_before"), $(this).removeClass("icon_change_after"), $("#mgj_rightbar_icon1_count").removeClass("count_bg_after").addClass("count_bg_before"), $("#mgj_rightbar_icon1_border").addClass("border_common").removeClass("border_common_mouseover")
		}), $("#mgj_rightbar_icon2").on("mouseover", function() {
			$(this).removeClass("icon_change_before"), $(this).addClass("icon_change_after"), $("#mgj_rightbar_icon2_count").removeClass("count_bg_before").addClass("count_bg_after"), $("#mgj_rightbar_icon1_border").removeClass("border_common").addClass("border_common_mouseover"), $("#mgj_rightbar_icon2_border").removeClass("border_common").addClass("border_common_mouseover")
		}).on("mouseout", function() {
			$(this).addClass("icon_change_before"), $(this).removeClass("icon_change_after"), $("#mgj_rightbar_icon2_count").removeClass("count_bg_after").addClass("count_bg_before"), $("#mgj_rightbar_icon1_border").addClass("border_common").removeClass("border_common_mouseover"), $("#mgj_rightbar_icon2_border").addClass("border_common").removeClass("border_common_mouseover")
		}), $("#mgj_rightbar_icon3").mouseover(function() {
			$(this).removeClass("icon_change_before"), $(this).addClass("icon_change_after"), $("#mgj_rightbar_icon2_border").removeClass("border_common"), $("#mgj_rightbar_icon2_border").addClass("border_common_mouseover"), $("#mgj_rightbar_icon3_border").removeClass("border_common"), $("#mgj_rightbar_icon3_border").addClass("border_common_mouseover")
		}), $("#mgj_rightbar_icon3").mouseout(function() {
			$(this).addClass("icon_change_before"), $(this).removeClass("icon_change_after"), $("#mgj_rightbar_icon2_border").addClass("border_common"), $("#mgj_rightbar_icon2_border").removeClass("border_common_mouseover"), $("#mgj_rightbar_icon3_border").addClass("border_common"), $("#mgj_rightbar_icon3_border").removeClass("border_common_mouseover")
		}), $("#mgj_rightbar_icon4").mouseover(function() {
			$(this).removeClass("icon_change_before"), $(this).addClass("icon_change_after"), $("#mgj_rightbar_icon3_border").removeClass("border_common"), $("#mgj_rightbar_icon3_border").addClass("border_common_mouseover"), $("#mgj_rightbar_icon4_border").removeClass("border_common"), $("#mgj_rightbar_icon4_border").addClass("border_common_mouseover")
		}), $("#mgj_rightbar_icon4").mouseout(function() {
			$(this).addClass("icon_change_before"), $(this).removeClass("icon_change_after"), $("#mgj_rightbar_icon3_border").addClass("border_common"), $("#mgj_rightbar_icon3_border").removeClass("border_common_mouseover"), $("#mgj_rightbar_icon4_border").addClass("border_common"), $("#mgj_rightbar_icon4_border").removeClass("border_common_mouseover")
		}), $("#mgj_rightbar_feedback").mouseover(function() {
			$(this).removeClass("icon_change_before"), $(this).addClass("icon_change_after"), $("#mgj_rightbar_feedback_border").removeClass("border_common"), $("#mgj_rightbar_feedback_border").addClass("border_common_mouseover")
		}), $("#mgj_rightbar_feedback").mouseout(function() {
			$(this).addClass("icon_change_before"), $(this).removeClass("icon_change_after"), $("#mgj_rightbar_feedback_border").addClass("border_common"), $("#mgj_rightbar_feedback_border").removeClass("border_common_mouseover")
		}), $(window).on("scroll", function(e) {
			$(this).scrollTop() ? $("#mgj_rightbar_back2top").css("display", "block") : $("#mgj_rightbar_back2top").css("display", "none")
		}), $("#mgj_rightbar_back2top").mouseover(function() {
			$(this).removeClass("icon_change_before"), $(this).addClass("icon_change_after"), $("#mgj_rightbar_feedback_border").removeClass("border_common"), $("#mgj_rightbar_feedback_border").addClass("border_common_mouseover")
		}), $("#mgj_rightbar_back2top").on("click", function(e) {
			$("html, body").animate({
				scrollTop: 0
			}, 300), $("#mgj_rightbar_feedback_border").addClass("border_common"), $("#mgj_rightbar_feedback_border").removeClass("border_common_mouseover")
		}), $("#mgj_rightbar_back2top").mouseout(function() {
			$(this).addClass("icon_change_before"), $(this).removeClass("icon_change_after"), $("#mgj_rightbar_feedback_border").addClass("border_common"), $("#mgj_rightbar_feedback_border").removeClass("border_common_mouseover")
		}), $(".mgj_rightbar_1200").on("mouseenter", function() {
			e && ($(".mgj_rightbar_960").animate({
				right: "0px"
			}, 500), $("#mgj_rightbar_icon1_border").addClass("border_common"))
		}), $(".mgj_rightbar").mouseleave(function() {
			e && ($(".mgj_rightbar_960").animate({
				right: "-30px"
			}, 500), $("#mgj_rightbar_icon1_border").removeClass("border_common"))
		})
	}(),
	function() {
		var e = {};
		e.Model = {
			goodsList: "",
			goodsNum: 0,
			getGoodsList: function(e) {
				var t = this;
				return t.goodsList ? void($.isFunction(e) && e(this.goodsList)) : void $.post("/trade/cart/shoptopcart?isnew=1", {}, function(o) {
					1001 == o.status.code && (t.goodsList = o.result.html, t.goodsNum = o.result.count || 0, $.isFunction(e) && e(t.goodsList))
				}, "json")
			},
			delGood: function(e, t) {
				$.post("/trade/cart/delete", {
					stockid: e
				}, function(e) {
					1001 == e.status.code ? $.isFunction(t) && t() : alert(e.status.msg)
				}, "json")
			}
		}, e.View = {
			wrap: $(".header_2015 .shopping_cart_v2"),
			init: function() {
				this.wrap.length && (this.extendInfo = null, this.loading = this.wrap.find(".shopping_cart_loading"), this.maxShowNum = 5, this.addEvent())
			},
			addEvent: function() {
				var t = this;
				t.wrap.on("mouseenter", function(o) {
					var r = $(this);
					r.addClass("sc_on"), t.loading.show(), t.extendInfo && t.extendInfo.length ? (t.loading.hide(), t.extendInfo.show()) : e.Model.getGoodsList(function(e) {
						t.extendInfo = $(e);
						var o = t.extendInfo.find("li");
						o.length > t.maxShowNum && o.slice(t.maxShowNum, o.length).remove(), r.append(t.extendInfo), t.loading.hide(), t.extendInfo.show()
					})
				}), t.wrap.on("mouseleave", function(e) {
					t.extendInfo && t.extendInfo.hide() && $(this).removeClass("sc_on")
				}), t.wrap.on("click", ".del", function() {
					var o = $(this),
						r = o.data("stockid"),
						n = (t.wrap.find(".num"), o.parent()),
						a = e.Model.goodsNum;
					e.Model.delGood(r, function() {
						a--, n.fadeOut("slow", function() {
							a ? (n.remove(), e.Model.goodsNum = a) : t.extendInfo.addClass("empty_cart").text("购物车里没有商品！")
						})
					})
				})
			}
		}, e.View.init()
	}(), $(function() {
		function e(e, t) {
			this.init(e, t)
		}

		function t() {
			function e(e) {
				return $.trim(e).replace(/(<|>|'|"|window|alert|eval|$|jQuery)/gi, "")
			}
			c.on("keyup keydown", function(o) {
				var r = $(this),
					n = $("#select_type");
				if (!n.length || "bao" === n.val() || "5" === n.val()) switch (o.keyCode) {
					case 40:
						if ("keyup" == o.type || !i.data("isshow")) break;
						g.chooseIndex = g.chooseIndex + 1 > g.tipLength - 1 ? 0 : ++g.chooseIndex;
						var a = f.changeListTab(g.chooseIndex);
						c.val(a);
						break;
					case 38:
						if ("keyup" == o.type || !i.data("isshow")) break;
						g.chooseIndex = g.chooseIndex - 1 < 0 ? g.tipLength - 1 : --g.chooseIndex;
						var a = f.changeListTab(g.chooseIndex);
						c.val(a);
						break;
					case 13:
						if ("keyup" == o.type) break;
						o.preventDefault(), t.submitBefore(g.chooseType, g.chooseIndex), d.submit();
						break;
					case 37:
						break;
					case 39:
						break;
					default:
						clearTimeout(s), s = setTimeout(function() {
							var t = e(r.val());
							f.resetFactory(t)
						}, 500)
				}
			}).on("focus", function() {
				var t = $(this),
					o = $("#select_type");
				if (s && clearTimeout(s), !o.length || "bao" === o.val() || "5" === o.val()) {
					var r = e(t.val());
					clearTimeout(s), s = setTimeout(function() {
						f.resetFactory(r)
					}, 300)
				}
			}).on("blur", function() {
				$("body").bind("click", function(e) {
					$(e.target).parents(".seatch_type_msearch").length || (i.empty().data("isshow", !0).hide(), $("body").unbind("click"))
				})
			}), i.on("mouseenter", ".search_tip li", function(e) {
				var t = $(this),
					o = t.index();
				g.chooseIndex = o, f.changeListTab(o)
			}).on("click", ".search_tip li", function(e) {
				var o = $(this).find(".title").text();
				$(e.target).hasClass("prop") && (o += " " + $(e.target).text()), t.submitBefore(g.chooseType, g.chooseIndex), c.val(o), d.submit()
			}), i.on("click", ".hot_list li", function() {
				var e = $(this);
				return t.submitBefore(f.hotTypeName, e.index()), c.val(e.find("span").html()), d.submit(), !1
			}), i.on("click", ".local_del", function(e) {
				var t = $(this),
					o = t.parent();
				u.del(o.find(".title").attr("title"));
				var r = u.getTenItem();
				return f.updateLocalContent(t, r), g.chooseIndex = -1, g.tipLength = r.length, !1
			}).on("click", ".local_title .del_all", function() {
				var e = $(this);
				return u.set(), f.destoryLocalContent(e), e.remove(), g.chooseIndex = -1, g.tipLength = 0, !1
			}), a.on("click", ".selectbox a", function(e) {
				e.preventDefault(), f.changeType($(this))
			}).on("mouseenter", ".selectbox", function() {
				i.hide(), $(this).addClass("sele_hover")
			}).on("mouseleave", ".selectbox", function() {
				$(this).removeClass("sele_hover")
			}), d.submit(function() {
				var o = $(this),
					r = e(c.val()),
					n = c.attr("def-v");
				if ("" == r || r == n) {
					if ("" == r && "shop" == $("#select_type").val()) return !1;
					var a = c.data("def");
					c.val(a || "");
					var s = '<input type="hidden" name="from" value="searchplacehold" id="TJ">';
					$("#top_nav_form").append(s), setTimeout(function() {
						$("#TJ").remove()
					}, 1e3)
				} else r == $.trim(c.val()) && "bao" == $("#select_type").val() && u.addOne(r);
				if (d.find(".emptyvalue").remove(), o.data("index") > -1 && null !== o.data("type")) {
					var i = '<input type="hidden" class="emptyvalue" name="from" value="' + o.data("type") + "querytip" + o.data("index") + '">';
					d.append(i)
				}
				f.destoryContent(), t.submitAfter()
			}), f.showStickySearch() && f.initStickySearch()
		}
		var o = window,
			r = o.doT,
			n = o.store;
		if (r && n) {
			$(".store_header").length;
			var a = $("#nav_search_form");
			if (a.length) {
				var s, i = $(".top_search_hint"),
					c = a.find(".ts_txt"),
					d = $("#top_nav_form"),
					h = $("#select_type"),
					m = a.find(".selectbox"),
					l = "/msearch/tips/item",
					_ = {
						nowHost: window.location.host,
						defultHost: "http://www.mogujie.com",
						template: '<div class="search_tip_box fl">{{=it.searchResult}}</div>',
						listItemTemp: ['<div class="mr300 tip_wrap">', '{{ if(it.titleName && it.titleName != ""){ }}', '<h3 class="search_tip_title">{{=it.titleName}}</h3>', "{{ }else{ }}", "{{ } }}", '<ul class="search_tip">', "{{~it.items :item:index}}", "{{ if(index < 10){ }}", "<li>", '<a href="javascript:;" class="title" title="{{= item.title }}" >{{= item.title }}</a>', "{{~item.props :prop: i}}", '<span class="prop">{{= prop }}</span>', "{{~}}", "</li>", "{{ } }}", "{{~}}", "</ul>", "</div>"].join(""),
						localItemTemp: ['<div class="mr300 tip_wrap">', '<h3 class="search_tip_title local_title clearfix">', "{{ if(it.items.length){ }}", '<span class="del_all">删除</span>', "{{ } }}", "历史记录", "</h3>", '<ul class="search_tip">', "{{~it.items :item:index}}", "{{ if(index < 10){ }}", '<li class="local_item">', '<a href="javascript:;" class="title" title="{{=item}}" >{{=item}}</a>', "{{~item.props :prop: i}}", '<span class="prop">{{= prop }}</span>', "{{~}}", '<span class="nums local_del">x</span>', "</li>", "{{ } }}", "{{~}}", "</ul>", "</div>"].join(""),
						hotKeyTpl: ['<div class="search_hot_wrap">', '<h3 class="search_tip_title hot_title">热门关键词</h3>', '<ul class="hot_list clearfix">', "{{~it.items :item:index}}", "{{ if(index < 10){ }}", "<li><span>{{= item.title }}</span></li>", "{{ } }}", "{{~}}", "</ul>", "</div>"].join(""),
						emptyTpl: ['<div class="mr300 tip_wrap">', '<p class="tip_none">暂无相关热门关键词</p>', "</div>"].join("")
					},
					u = {
						keyName: "_search_local_history",
						keyShowName: "_search_local_history_show",
						maxLength: 20,
						showLength: 10,
						isshow: function() {
							return !0
						},
						abtest: function(e) {
							n.set(this.keyShowName, 1)
						},
						get: function() {
							return n.get(this.keyName) || []
						},
						getTenItem: function() {
							var e = this.get();
							return e.slice(0, this.showLength)
						},
						set: function(e) {
							n.set(this.keyName, e || [])
						},
						addOne: function(e) {
							if (e = $.trim(e), "" != e) {
								var t = this.get(),
									o = $.inArray(e, t); - 1 == o ? (t.unshift(e), t.length > this.maxLength && t.pop()) : (t.splice(o, 1), t.unshift(e)), this.set(t)
							}
						},
						del: function(e) {
							e = $.trim(e);
							var t = this.get(),
								o = $.inArray(e, t);
							o > -1 && (t.splice(o, 1), this.set(t))
						}
					};
				e.prototype.init = function(e, t) {
					this.chooseIndex = -1, this.chooseType = e, this.tipLength = t || 0
				};
				var g = new e("undefined"),
					f = {
						ajaxRequest: null,
						hotKeyArr: [],
						isShopHost: function() {
							return !1
						},
						showStickySearch: function() {
							var e = location.pathname,
								t = $(".mgj_primary"),
								o = t.length > 0 ? t.offset().top + t.height() : 10;
							return "www.mogujie.com" === location.host && ("/" === e || "/more" === e) || e.indexOf("/book/search/") > -1 || /webdemo || localhost/.test(location.host) && /sticky/.test(location.search) ? (e.indexOf("/book/search/") > -1 && (t = $(".search_filter_wrap"), o = t.length ? t.offset().top : 150), this.stickyTargetTop = o, !0) : !1
						},
						resetFactory: function(e) {
							this.isShopHost() ? this.resetShopContent(e) : u.isshow() ? this.resetListContent(e) : this.resetOldContent(e)
						},
						resetListContent: function(t) {
							function o(e) {
								n(function() {
									a()
								})
							}

							function n(o) {
								s.ajaxRequest && s.ajaxRequest.abort();
								var r = u.getTenItem();
								return "" == $.trim(t) ? (c.push(s.renderLocalContent(r)), void($.isFunction(o) && o())) : void(s.ajaxRequest = $.post(l, {
									input: t
								}, function(t) {
									if (t && 1001 == t.status.code) {
										var r = t.result.tipCount;
										0 == r ? c.push(s.renderEmptyContent()) : (c.push(s.renderSearchContent(t.result.tips, t.result.nums, t.result.props)), g = new e(s.searchTypeName, r))
									}
									$.isFunction(o) && o()
								}, "json"))
							}

							function a() {
								var e = r.template(_.template)({
									searchResult: c.join("")
								});
								i.html(e), s.showContentBox()
							}
							var s = this,
								c = [];
							s.hotKeyArr.length ? o(s.hotKeyArr) : $.post(l, {}, function(e) {
								s.hotKeyArr = e.result.tips, o(s.hotKeyArr)
							}, "json")
						},
						resetShopContent: function(t) {
							function o(o) {
								a.ajaxRequest && a.ajaxRequest.abort(), a.ajaxRequest = $.post(l, {
									input: t
								}, function(t) {
									if (t && 1001 == t.status.code) {
										var r = t.result.tipCount;
										0 == r ? s.push(a.renderEmptyContent()) : (s.push(a.renderSearchContent(t.result.tips, t.result.nums, t.result.props, c)), g = new e(d, r))
									}
									$.isFunction(o) && o()
								}, "json")
							}

							function n() {
								var e = r.template(_.template)({
									searchResult: s.join("")
								});
								i.html(e), a.showContentBox()
							}
							var a = this,
								s = [],
								c = "",
								d = "" != t ? a.searchTypeName : a.hotTypeName;
							o(function() {
								n()
							})
						},
						resetOldContent: function(t) {
							function o(o) {
								a.ajaxRequest && a.ajaxRequest.abort(), a.ajaxRequest = $.post(l, {
									input: t
								}, function(t) {
									if (t && 1001 == t.status.code) {
										var r = t.result.tipCount;
										0 == r ? s.push(a.renderEmptyContent()) : (s.push(a.renderSearchContent(t.result.tips, t.result.nums, c)), g = new e(d, r))
									}
									$.isFunction(o) && o()
								}, "json")
							}

							function n() {
								var e = r.template(_.template)({
									searchResult: s.join("")
								});
								i.html(e), i.find(".tip_wrap").removeClass("mr300").addClass("mr300_fix"), a.showContentBox()
							}
							var a = this,
								s = [],
								c = "" != t ? "搜索结果" : "热门关键词",
								d = "" != t ? a.searchTypeName : a.hotTypeName;
							o(function() {
								n()
							})
						},
						searchTypeName: "",
						renderSearchContent: function(e, t, o, n) {
							for (var a = [], s = 0; s < e.length; s++) a.push({
								title: e[s],
								props: o[s],
								num: t[s]
							});
							return r.template(_.listItemTemp)({
								titleName: n || null,
								items: a
							})
						},
						localTypeName: "local",
						renderLocalContent: function(e) {
							return r.template(_.localItemTemp)({
								items: e
							})
						},
						updateLocalContent: function(e, t) {
							var o = e.parent(),
								r = e.parents(".search_tip");
							if (o.length && r.length)
								if (t.length < u.showLength) o.remove();
								else {
									var n = t[u.showLength - 1];
									o.find(".title").attr("title", n).html(n), o.appendTo(r)
								}
						},
						destoryLocalContent: function(e) {
							var t = e.parents(".tip_wrap").find(".search_tip");
							t.length && t.empty()
						},
						hotTypeName: "default",
						renderHotContent: function(e) {
							for (var t = [], o = 0; o < e.length; o++) t.push({
								title: e[o]
							});
							return r.template(_.hotKeyTpl)({
								items: t
							})
						},
						renderEmptyContent: function() {
							return _.emptyTpl
						},
						destoryContent: function() {
							i.empty().hide()
						},
						getContentPosition: function(e, t) {
							var o = t.offset(),
								r = e.data("fixleft"),
								n = e.data("fixtop");
							r && (o.left += parseInt(r)), n && (o.top -= parseInt(n));
							var a = t.width() - 34;
							e.css({
								left: o.left,
								top: o.top + t.height() + 2,
								width: a
							}).addClass("hasposition")
						},
						showContentBox: function() {
							i.show().data("isshow", !0)
						},
						changeListTab: function(e) {
							var t = i.find(".search_tip li"),
								o = t.eq(e);
							return t.removeClass("checked"), o.addClass("checked"), o.find(".title").text()
						},
						changeType: function(e) {
							var t = e.parent(),
								o = t.attr("data-index"),
								r = e.text();
							if (h.val(o), m.find(".selected").text("搜" + r), t.siblings("li").removeClass("current"), t.addClass("current"), "shop" == o) c.val() == c.attr("def-v") && c.val("");
							else if ("" == c.val()) {
								var n = c.attr("def-v");
								c.val(n)
							}
							4 == o ? "shop.mogujie.com" === _.nowHost ? d.attr("action", _.defultHost + "/group/search/") : d.attr("action", "/group/search/") : "shop.mogujie.com" === _.nowHost ? d.attr("action", _.defultHost + "/search") : d.attr("action", "/search/"), m.removeClass("sele_hover")
						},
						initStickySearch: function() {
							var e = $("#nav_search_form"),
								t = ['<div id="J_sticky_container" class="sticky-search-container">', '<div class="wrap">', '<a rel="nofollow" href="webdemo.com/pc/" class="logo" title="蘑菇街|我的买手街">蘑菇街|我的买手街</a>', '<div class="sticky-search-content"></div>', "</div>", "</div>"].join("");
							$("body").append(t);
							var o = $(".sticky-search-container");
							$(window).off("scroll.sticky").on("scroll.sticky", function() {
								$(document).scrollTop() > f.stickyTargetTop ? o.find(".sticky-search-content").append(e).end().addClass("lets-rock") : ($(".normal-search-content").append($("#nav_search_form")), o.find(".sticky-search-content").empty().end().removeClass("lets-rock"))
							})
						}
					};
				t.submitBefore = function(e, t) {
					d.data({
						type: e,
						index: t
					})
				}, t.submitAfter = function() {
					d.removeData("type index"), g.chooseType = "undefined", g.chooseIndex = -1
				};
				var p = function() {
					MOGU.Globe_Input_Text_Hide(c), "www.mogujie.com" === _.nowHost || m.parents(".store_header").length || d.attr("action", _.defultHost + d.attr("action")), t()
				};
				p()
			}
		}
	});
(function(a) {
	MOGU.Add_To_Album_Init = function(f, g) {
		if (MOGU.Globe_Check_Login()) {
			var d = new MGLightBox({
				title: "\u52a0\u5165\u4e13\u8f91",
				lightBoxId: "lb_addalbum",
				scroll: !1,
				ajax: !0,
				isBgClickClose: !0,
				type: "default"
			});
			d.init();
			var e = f.attr("type"),
				h = f.attr("iid");
			a.ajax({
				url: "/album/beforeaddalbum",
				type: "post",
				timeout: 6E4,
				data: {
					img_type: e,
					img_id: h,
					tid: g
				},
				dataType: "json",
				success: function(b) {
					if (b == null) alert(MGLANG.msgTimeOut);
					else {
						var c = b.status.msg;
						b.status.code == 1001 ? (d.buildContent(b.result.html), MOGU.WB_Word_Count("lb_addalbum",
							"pub_content"), MOGU.Globe_Input_Text_Hide(a(".pub_box_op .pub_txt")), MOGU.Album_Add_To_Album(g, e, h, d)) : alert(c)
					}
				},
				error: function(a, c) {
					"timeout" == c && alert(MGLANG.msgTimeout)
				}
			})
		}
	};
	MOGU.Album_Add_To_Album = function(f, g, d, e) {
		a(".album_add_content .album_text").focus(function() {
			a("#lb_addalbum .album_add_content").removeClass("hide_content")
		});
		a("#lb_addalbum .submit").click(function() {
			var h = a("#lb_addalbum"),
				b = a("#lb_addalbum .album_text"),
				c = a.trim(b.val()),
				b = a.trim(b.attr("def-v"));
			c == b && (c = "");
			var b =
				a("#lb_addalbum .choose").data("albumid"),
				j = a("#lb_addalbum .choose").attr("valid"),
				k = a("#lb_addalbum .choose").attr("validcode"),
				i = "";
			a("#lb_addalbum #pub_out_check").attr("checked") == "checked" && (i = 1);
			c = {
				tid: f,
				imgType: g,
				imgId: d,
				content: c,
				albumId: b,
				sync: i,
				valid: j,
				validcode: k
			};
			if (typeof c.albumId == "undefined" && (b = h.find(".choose").attr("albumid"), typeof b == "undefined")) return alert("\u4f60\u8fd8\u672a\u9009\u62e9\u4e13\u8f91"), !1;
			c.albumId = b;
			a(this).hide();
			a(this).next().show();
			a.ajax({
				url: "/album/addajax",
				type: "POST",
				timeout: 6E4,
				data: c,
				dataType: "json",
				success: function(a) {
					if (a == null) alert(MGLANG.msgTimeout);
					else {
						var b = a.status.msg;
						a.status.code == 1001 ? e.success_close("\u52a0\u5165\u4e13\u8f91\u6210\u529f\uff01", 600) : (e.close(), alert(b))
					}
				},
				error: function(a, b) {
					"timeout" == b && alert(MGLANG.msgTimeout)
				}
			})
		});
		MOGU.Globe_Bind_Keybord_Submit(a("#lb_addalbum .album_text"), a("#lb_addalbum .submit"), "not_need_focus")
	}
})(jQuery);
(function(c) {
	MOGU.Message_Report_Init = function(e, d) {
		var a = MOGUPROFILE.userid,
			f = new MGLightBox({
				title: "\u4e3e\u62a5\u4e0d\u826f\u4fe1\u606f",
				lightBoxId: "lb_jubao",
				ajax: !0,
				scroll: !1
			});
		f.init();
		c.ajax({
			url: "/report/getreportinfo",
			data: {
				messageid: e,
				type: d,
				userid: a
			},
			dataType: "json",
			type: "POST",
			timeout: 6E4,
			success: function(b) {
				if (b == null) alert(MGLANG.msgTimeout);
				else {
					var a = b.status.msg;
					b.status.code == 1001 ? (b = b.result.data, f.buildContent(doT.template('<div class="lb_border"><p class="fw_root"><img src="/img/message-icon.png">\u4e0d\u826f\u4fe1\u606f\u662f\u6307\u542b\u6709\u5404\u7c7b\u5356\u5bb6\u5e97\u94fa\u3001\u5546\u54c1\u5e7f\u544a\u3001\u865a\u5047\u4e2d\u5956\u4fe1\u606f\u6216\u5176\u4ed6\u9a9a\u6270\u4f60\u6b63\u5e38\u8611\u83c7\u8857\u751f\u6d3b\u7684\u5185\u5bb9</p></div><div class="fw_pub_area"><div class="fwpa_tool">\u4f60\u8981\u4e3e\u62a5\u7684\u662f<a class="fwpa_a" href="/u/{{= it.fromId }}">@{{= it.uname }}</a>\u7684{{= it.type_text }}\uff1a</div><div class="fwpa_s"><a href="/u/{{= it.fromId }}"><img class="pic_t r3" src="{{= it.avatar }}"></a><div class="fwpa_c">{{ if(!MGTOOL.empty(it.title)){ }}<div class="fwpa_f">{{= it.title }}</div><br />{{ } }}<span >{{= it.content }}</span></div></div><div class="fwpa_p"><span>\u4e3e\u62a5\u7c7b\u578b\uff1a</span><input id="s_m" style="margin-left:3px;" type="radio" name="s" value="0" checked="checked" ><label for="s_m">\u5356\u5bb6\u5e7f\u544a\uff08\u5e97\u94fa\u3001\u5546\u54c1\uff09</label><input id="s_j" type="radio" name="s" value="1"><label for="s_j">\u865a\u5047\u4e2d\u5956\u4fe1\u606f</label><input id="s_e" type="radio" name="s" value="2"><label for="s_e">\u5176\u4ed6</label></div><div class="fwpa_ww">\u8865\u5145\u8bf4\u660e<span>(\u9009\u586b)</span>\uff1a<input class="fwpa_shu r3" type="text" name="n" ></div></div><div class="sub_div"><a href="javascript:;"  class="subreport"><img src="/img/message-button.png"></a><span class="fw_cancel">\u8bf7\u653e\u5fc3,\u6211\u4eec\u4f1a\u5c3d\u5feb\u5904\u7406\uff0c\u4f60\u7684\u9690\u79c1\u5c06\u4f1a\u5f97\u5230\u4fdd\u62a4</span></div>')(b)),
						b = {
							reportpage: d,
							messageId: e,
							reportFromId: b.toId,
							reportToId: b.fromId
						}, MOGU.Globe_Bind_Keybord_Submit("", c("#lb_jubao .subreport"), "not_need_focus"), MOGU.Message_Report_Submit(f, b)) : alert(a)
				}
			},
			error: function(b, a) {
				"timeout" == a && alert(MGLANG.msgTimeout)
			}
		})
	};
	MOGU.Message_Report_Submit = function(e, d) {
		c("#lb_jubao .subreport").click(function() {
			var a = c("#lb_jubao .fwpa_p input[name='s']:checked").val();
			a == null || a == void 0 ? alert("\u8bf7\u9009\u62e9\u4e3e\u62a5\u7c7b\u578b") : (d.type = a, a = c("#lb_jubao .fwpa_shu").val(),
				d.remark = a, c.ajax({
					url: "/report/subreport",
					data: d,
					dataType: "json",
					type: "POST",
					timeout: 6E4,
					success: function(a) {
						if (a == null) alert(MGLANG.msgTimeout);
						else {
							var b = a.status.msg;
							a.status.code == 1001 ? e.success_close("\u4e3e\u62a5\u6210\u529f\uff0c\u8c22\u8c22\uff01\u7259\u7259\u4f1a\u7a0d\u5019\u5904\u7406\u3002") : alert(b)
						}
					},
					error: function(a, b) {
						"timeout" == b && alert(MGLANG.msgTimeout)
					}
				}))
		})
	}
})(jQuery);
(function(a) {
	MOGU.imgCodeCheck = function() {
		var t = false;
		var i = a(".img_code_spin");
		if (i.length == 0) {
			t = true;
			return t
		}
		for (var c = 0; c < i.length; c++) {
			var e = a(i[c]);
			if (e.val() != 0) {
				t = true;
				break
			}
		}
		return t
	};
	MOGU.imgCaptchaInit = function() {
		var t = a(".imgcheck_image_div");
		var i = a("#imgcheck_code_change");
		var c = function(a, t) {
			var i = -75 * ((t + 1) % 4);
			var c = a[0].style.backgroundPosition.split(" ");
			a[0].style.backgroundPosition = c[0] + " " + i + "px"
		};
		t.click(function() {
			var t = a(this).attr("f");
			var i = a("#img_code_spin_" + t);
			var e = parseInt(i.val());
			c(a(this), e);
			i.val(e + 1)
		});
		i.click(function() {
			MOGU.imgCaptchaRecaptcha()
		})
	};
	MOGU.imgCaptchaRecaptcha = function(t) {
		var i = function(t) {
			var i = a(".imgcheck_image_div");
			var c = i.length;
			for (var e = 0; e < c; e++) {
				var r = i[e];
				var n = r.getAttribute("f");
				var o = a("#img_code_spin_" + n);
				o.val(0);
				var u = a(r);
				u.css("background-image", "url(/captchaimg/" + t + ")");
				u.css({
					"background-position": -75 * e + "px 0"
				})
			}
		};
		if (t === undefined) {
			a.ajax({
				url: "/reimgcaptcha",
				type: "POST",
				timeout: 6e4,
				data: {},
				dataType: "json",
				cache: false,
				success: function(a) {
					var t = a.status.code;
					var c = a.status.msg;
					if (t == 1001) {
						var e = a.result.data.captchaId;
						i(e)
					}
				},
				error: function(a, t, i) {
					if ("timeout" == t) {
						alert(MGLANG.msgTimeout)
					}
				}
			})
		} else {
			setTimeout(function() {
				i(t)
			}, 1)
		}
	};
	MOGU.imgCaptchaInit()
})(jQuery);